
(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 3e+15)
(+
(- 0.91893853320467 (fma (log x) (- 0.5 x) x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3e+15) {
tmp = (0.91893853320467 - fma(log(x), (0.5 - x), x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3e+15) 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(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3e+15], 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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3 \cdot 10^{+15}:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 3e15Initial program 99.6%
remove-double-neg99.6%
+-commutative99.6%
associate-+r-99.7%
remove-double-neg99.7%
sub-neg99.7%
associate--r+99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-def99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
unsub-neg99.7%
remove-double-neg99.7%
Simplified99.7%
if 3e15 < x Initial program 85.0%
remove-double-neg85.0%
remove-double-neg85.0%
sub-neg85.0%
metadata-eval85.0%
*-commutative85.0%
fma-def85.0%
fma-neg85.0%
metadata-eval85.0%
Simplified85.0%
clear-num85.0%
metadata-eval85.0%
fma-neg85.0%
fma-udef85.0%
*-commutative85.0%
inv-pow85.0%
*-commutative85.0%
fma-udef85.0%
fma-neg85.0%
metadata-eval85.0%
fma-udef85.0%
*-commutative85.0%
fma-def85.0%
Applied egg-rr85.0%
Taylor expanded in z around inf 85.0%
associate-/l*91.5%
associate-/r/92.2%
unpow292.2%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around inf 99.7%
*-commutative99.7%
sub-neg99.7%
*-commutative99.7%
metadata-eval99.7%
distribute-lft1-in99.7%
+-commutative99.7%
+-commutative99.7%
distribute-lft1-in99.7%
*-commutative99.7%
mul-1-neg99.7%
log-rec99.7%
remove-double-neg99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))))
(if (or (<= z -680000000.0) (not (<= z 5.5e-35)))
(+ (* (+ y 0.0007936500793651) (/ z (/ x z))) t_0)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x + -0.5)) - x);
double tmp;
if ((z <= -680000000.0) || !(z <= 5.5e-35)) {
tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0;
} 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 = 0.91893853320467d0 + ((log(x) * (x + (-0.5d0))) - x)
if ((z <= (-680000000.0d0)) .or. (.not. (z <= 5.5d-35))) then
tmp = ((y + 0.0007936500793651d0) * (z / (x / z))) + t_0
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 = 0.91893853320467 + ((Math.log(x) * (x + -0.5)) - x);
double tmp;
if ((z <= -680000000.0) || !(z <= 5.5e-35)) {
tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0;
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x + -0.5)) - x) tmp = 0 if (z <= -680000000.0) or not (z <= 5.5e-35): tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0 else: tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) 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 ((z <= -680000000.0) || !(z <= 5.5e-35)) tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z))) + t_0); 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 = 0.91893853320467 + ((log(x) * (x + -0.5)) - x); tmp = 0.0; if ((z <= -680000000.0) || ~((z <= 5.5e-35))) tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0; 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[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -680000000.0], N[Not[LessEqual[z, 5.5e-35]], $MachinePrecision]], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $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 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
\mathbf{if}\;z \leq -680000000 \lor \neg \left(z \leq 5.5 \cdot 10^{-35}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if z < -6.8e8 or 5.4999999999999997e-35 < z Initial program 85.5%
remove-double-neg85.5%
remove-double-neg85.5%
sub-neg85.5%
metadata-eval85.5%
*-commutative85.5%
fma-def85.5%
fma-neg85.5%
metadata-eval85.5%
Simplified85.5%
clear-num85.5%
metadata-eval85.5%
fma-neg85.5%
fma-udef85.5%
*-commutative85.5%
inv-pow85.5%
*-commutative85.5%
fma-udef85.5%
fma-neg85.5%
metadata-eval85.5%
fma-udef85.5%
*-commutative85.5%
fma-def85.5%
Applied egg-rr85.5%
Taylor expanded in z around inf 84.6%
associate-/l*90.3%
associate-/r/91.6%
unpow291.6%
associate-/l*98.8%
Simplified98.8%
if -6.8e8 < z < 5.4999999999999997e-35Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
fma-def99.4%
fma-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 97.8%
Final simplification98.3%
(FPCore (x y z)
:precision binary64
(if (<= x 1.06e+14)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.06e+14) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.06d+14) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (z / (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.06e+14) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.06e+14: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.06e+14) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.06e+14) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.06e+14], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.06 \cdot 10^{+14}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 1.06e14Initial program 99.6%
if 1.06e14 < x Initial program 85.0%
remove-double-neg85.0%
remove-double-neg85.0%
sub-neg85.0%
metadata-eval85.0%
*-commutative85.0%
fma-def85.0%
fma-neg85.0%
metadata-eval85.0%
Simplified85.0%
clear-num85.0%
metadata-eval85.0%
fma-neg85.0%
fma-udef85.0%
*-commutative85.0%
inv-pow85.0%
*-commutative85.0%
fma-udef85.0%
fma-neg85.0%
metadata-eval85.0%
fma-udef85.0%
*-commutative85.0%
fma-def85.0%
Applied egg-rr85.0%
Taylor expanded in z around inf 85.0%
associate-/l*91.5%
associate-/r/92.2%
unpow292.2%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in x around inf 99.7%
*-commutative99.7%
sub-neg99.7%
*-commutative99.7%
metadata-eval99.7%
distribute-lft1-in99.7%
+-commutative99.7%
+-commutative99.7%
distribute-lft1-in99.7%
*-commutative99.7%
mul-1-neg99.7%
log-rec99.7%
remove-double-neg99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))))
(if (or (<= z -520000000.0) (not (<= z 1.65e-34)))
(+ (* (+ y 0.0007936500793651) (/ z (/ x z))) t_0)
(+ t_0 (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x + -0.5)) - x);
double tmp;
if ((z <= -520000000.0) || !(z <= 1.65e-34)) {
tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0;
} else {
tmp = t_0 + ((0.083333333333333 + (z * -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 = 0.91893853320467d0 + ((log(x) * (x + (-0.5d0))) - x)
if ((z <= (-520000000.0d0)) .or. (.not. (z <= 1.65d-34))) then
tmp = ((y + 0.0007936500793651d0) * (z / (x / z))) + t_0
else
tmp = t_0 + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
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 ((z <= -520000000.0) || !(z <= 1.65e-34)) {
tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0;
} else {
tmp = t_0 + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x + -0.5)) - x) tmp = 0 if (z <= -520000000.0) or not (z <= 1.65e-34): tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0 else: tmp = t_0 + ((0.083333333333333 + (z * -0.0027777777777778)) / x) 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 ((z <= -520000000.0) || !(z <= 1.65e-34)) tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z))) + t_0); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); 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 ((z <= -520000000.0) || ~((z <= 1.65e-34))) tmp = ((y + 0.0007936500793651) * (z / (x / z))) + t_0; else tmp = t_0 + ((0.083333333333333 + (z * -0.0027777777777778)) / x); 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[Or[LessEqual[z, -520000000.0], N[Not[LessEqual[z, 1.65e-34]], $MachinePrecision]], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $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}\;z \leq -520000000 \lor \neg \left(z \leq 1.65 \cdot 10^{-34}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\end{array}
\end{array}
if z < -5.2e8 or 1.64999999999999991e-34 < z Initial program 85.5%
remove-double-neg85.5%
remove-double-neg85.5%
sub-neg85.5%
metadata-eval85.5%
*-commutative85.5%
fma-def85.5%
fma-neg85.5%
metadata-eval85.5%
Simplified85.5%
clear-num85.5%
metadata-eval85.5%
fma-neg85.5%
fma-udef85.5%
*-commutative85.5%
inv-pow85.5%
*-commutative85.5%
fma-udef85.5%
fma-neg85.5%
metadata-eval85.5%
fma-udef85.5%
*-commutative85.5%
fma-def85.5%
Applied egg-rr85.5%
Taylor expanded in z around inf 84.6%
associate-/l*90.3%
associate-/r/91.6%
unpow291.6%
associate-/l*98.8%
Simplified98.8%
if -5.2e8 < z < 1.64999999999999991e-34Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
fma-def99.4%
fma-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.4%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (* (log x) -0.5)))
(t_1 (+ t_0 (* 0.0007936500793651 (/ (* z z) x)))))
(if (<= z -8.8e+223)
t_1
(if (<= z -2.15e+126)
(+
(* x (+ (log x) -1.0))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
(if (<= z -2.8e+61)
(+ t_0 (* 0.0007936500793651 (/ z (/ x z))))
(if (<= z 1.4e+43)
(+
(+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))
(/ 0.083333333333333 x))
t_1))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + (log(x) * -0.5);
double t_1 = t_0 + (0.0007936500793651 * ((z * z) / x));
double tmp;
if (z <= -8.8e+223) {
tmp = t_1;
} else if (z <= -2.15e+126) {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else if (z <= -2.8e+61) {
tmp = t_0 + (0.0007936500793651 * (z / (x / z)));
} else if (z <= 1.4e+43) {
tmp = (0.91893853320467 + ((log(x) * (x + -0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.91893853320467d0 + (log(x) * (-0.5d0))
t_1 = t_0 + (0.0007936500793651d0 * ((z * z) / x))
if (z <= (-8.8d+223)) then
tmp = t_1
else if (z <= (-2.15d+126)) then
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
else if (z <= (-2.8d+61)) then
tmp = t_0 + (0.0007936500793651d0 * (z / (x / z)))
else if (z <= 1.4d+43) then
tmp = (0.91893853320467d0 + ((log(x) * (x + (-0.5d0))) - x)) + (0.083333333333333d0 / x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + (Math.log(x) * -0.5);
double t_1 = t_0 + (0.0007936500793651 * ((z * z) / x));
double tmp;
if (z <= -8.8e+223) {
tmp = t_1;
} else if (z <= -2.15e+126) {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else if (z <= -2.8e+61) {
tmp = t_0 + (0.0007936500793651 * (z / (x / z)));
} else if (z <= 1.4e+43) {
tmp = (0.91893853320467 + ((Math.log(x) * (x + -0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + (math.log(x) * -0.5) t_1 = t_0 + (0.0007936500793651 * ((z * z) / x)) tmp = 0 if z <= -8.8e+223: tmp = t_1 elif z <= -2.15e+126: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) elif z <= -2.8e+61: tmp = t_0 + (0.0007936500793651 * (z / (x / z))) elif z <= 1.4e+43: tmp = (0.91893853320467 + ((math.log(x) * (x + -0.5)) - x)) + (0.083333333333333 / x) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(log(x) * -0.5)) t_1 = Float64(t_0 + Float64(0.0007936500793651 * Float64(Float64(z * z) / x))) tmp = 0.0 if (z <= -8.8e+223) tmp = t_1; elseif (z <= -2.15e+126) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); elseif (z <= -2.8e+61) tmp = Float64(t_0 + Float64(0.0007936500793651 * Float64(z / Float64(x / z)))); elseif (z <= 1.4e+43) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(0.083333333333333 / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + (log(x) * -0.5); t_1 = t_0 + (0.0007936500793651 * ((z * z) / x)); tmp = 0.0; if (z <= -8.8e+223) tmp = t_1; elseif (z <= -2.15e+126) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); elseif (z <= -2.8e+61) tmp = t_0 + (0.0007936500793651 * (z / (x / z))); elseif (z <= 1.4e+43) tmp = (0.91893853320467 + ((log(x) * (x + -0.5)) - x)) + (0.083333333333333 / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(0.0007936500793651 * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+223], t$95$1, If[LessEqual[z, -2.15e+126], 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], If[LessEqual[z, -2.8e+61], N[(t$95$0 + N[(0.0007936500793651 * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+43], 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], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \log x \cdot -0.5\\
t_1 := t_0 + 0.0007936500793651 \cdot \frac{z \cdot z}{x}\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{+126}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+61}:\\
\;\;\;\;t_0 + 0.0007936500793651 \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+43}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.7999999999999999e223 or 1.40000000000000009e43 < z Initial program 92.4%
remove-double-neg92.4%
remove-double-neg92.4%
sub-neg92.4%
metadata-eval92.4%
*-commutative92.4%
fma-def92.4%
fma-neg92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in y around 0 63.5%
Taylor expanded in x around 0 61.9%
Taylor expanded in z around inf 61.9%
unpow261.9%
Simplified61.9%
if -8.7999999999999999e223 < z < -2.1500000000000001e126Initial program 57.6%
remove-double-neg57.6%
remove-double-neg57.6%
sub-neg57.6%
metadata-eval57.6%
*-commutative57.6%
fma-def57.6%
fma-neg57.6%
metadata-eval57.6%
Simplified57.6%
Taylor expanded in z around 0 55.9%
Taylor expanded in x around inf 55.9%
*-commutative99.6%
sub-neg99.6%
*-commutative99.6%
metadata-eval99.6%
distribute-lft1-in99.6%
+-commutative99.6%
+-commutative99.6%
distribute-lft1-in99.6%
*-commutative99.6%
mul-1-neg99.6%
log-rec99.6%
remove-double-neg99.6%
Simplified55.9%
if -2.1500000000000001e126 < z < -2.8000000000000001e61Initial program 92.4%
remove-double-neg92.4%
remove-double-neg92.4%
sub-neg92.4%
metadata-eval92.4%
*-commutative92.4%
fma-def92.4%
fma-neg92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in y around 0 58.7%
Taylor expanded in x around 0 50.7%
Taylor expanded in z around inf 50.5%
unpow250.5%
associate-/l*50.5%
Simplified50.5%
if -2.8000000000000001e61 < z < 1.40000000000000009e43Initial program 97.1%
remove-double-neg97.1%
remove-double-neg97.1%
sub-neg97.1%
metadata-eval97.1%
*-commutative97.1%
fma-def97.1%
fma-neg97.1%
metadata-eval97.1%
Simplified97.1%
Taylor expanded in z around 0 89.0%
Final simplification77.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (* (log x) -0.5)))
(t_1 (+ t_0 (* 0.0007936500793651 (/ (* z z) x)))))
(if (<= z -8.5e+223)
t_1
(if (<= z -5.6e+125)
(+
(* x (+ (log x) -1.0))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
(if (<= z -1.2e+64)
(+ t_0 (* 0.0007936500793651 (/ z (/ x z))))
(if (<= z 3.2e+42)
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(/ 0.083333333333333 x))
t_1))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + (log(x) * -0.5);
double t_1 = t_0 + (0.0007936500793651 * ((z * z) / x));
double tmp;
if (z <= -8.5e+223) {
tmp = t_1;
} else if (z <= -5.6e+125) {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else if (z <= -1.2e+64) {
tmp = t_0 + (0.0007936500793651 * (z / (x / z)));
} else if (z <= 3.2e+42) {
tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.91893853320467d0 + (log(x) * (-0.5d0))
t_1 = t_0 + (0.0007936500793651d0 * ((z * z) / x))
if (z <= (-8.5d+223)) then
tmp = t_1
else if (z <= (-5.6d+125)) then
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
else if (z <= (-1.2d+64)) then
tmp = t_0 + (0.0007936500793651d0 * (z / (x / z)))
else if (z <= 3.2d+42) then
tmp = ((log(x) * (x + (-0.5d0))) - (x + (-0.91893853320467d0))) + (0.083333333333333d0 / x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + (Math.log(x) * -0.5);
double t_1 = t_0 + (0.0007936500793651 * ((z * z) / x));
double tmp;
if (z <= -8.5e+223) {
tmp = t_1;
} else if (z <= -5.6e+125) {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
} else if (z <= -1.2e+64) {
tmp = t_0 + (0.0007936500793651 * (z / (x / z)));
} else if (z <= 3.2e+42) {
tmp = ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + (math.log(x) * -0.5) t_1 = t_0 + (0.0007936500793651 * ((z * z) / x)) tmp = 0 if z <= -8.5e+223: tmp = t_1 elif z <= -5.6e+125: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) elif z <= -1.2e+64: tmp = t_0 + (0.0007936500793651 * (z / (x / z))) elif z <= 3.2e+42: tmp = ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(log(x) * -0.5)) t_1 = Float64(t_0 + Float64(0.0007936500793651 * Float64(Float64(z * z) / x))) tmp = 0.0 if (z <= -8.5e+223) tmp = t_1; elseif (z <= -5.6e+125) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); elseif (z <= -1.2e+64) tmp = Float64(t_0 + Float64(0.0007936500793651 * Float64(z / Float64(x / z)))); elseif (z <= 3.2e+42) tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + (log(x) * -0.5); t_1 = t_0 + (0.0007936500793651 * ((z * z) / x)); tmp = 0.0; if (z <= -8.5e+223) tmp = t_1; elseif (z <= -5.6e+125) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); elseif (z <= -1.2e+64) tmp = t_0 + (0.0007936500793651 * (z / (x / z))); elseif (z <= 3.2e+42) tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(0.0007936500793651 * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+223], t$95$1, If[LessEqual[z, -5.6e+125], 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], If[LessEqual[z, -1.2e+64], N[(t$95$0 + N[(0.0007936500793651 * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+42], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \log x \cdot -0.5\\
t_1 := t_0 + 0.0007936500793651 \cdot \frac{z \cdot z}{x}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+223}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{+125}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+64}:\\
\;\;\;\;t_0 + 0.0007936500793651 \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+42}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.5000000000000005e223 or 3.20000000000000002e42 < z Initial program 92.4%
remove-double-neg92.4%
remove-double-neg92.4%
sub-neg92.4%
metadata-eval92.4%
*-commutative92.4%
fma-def92.4%
fma-neg92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in y around 0 63.5%
Taylor expanded in x around 0 61.9%
Taylor expanded in z around inf 61.9%
unpow261.9%
Simplified61.9%
if -8.5000000000000005e223 < z < -5.6000000000000002e125Initial program 57.6%
remove-double-neg57.6%
remove-double-neg57.6%
sub-neg57.6%
metadata-eval57.6%
*-commutative57.6%
fma-def57.6%
fma-neg57.6%
metadata-eval57.6%
Simplified57.6%
Taylor expanded in z around 0 55.9%
Taylor expanded in x around inf 55.9%
*-commutative99.6%
sub-neg99.6%
*-commutative99.6%
metadata-eval99.6%
distribute-lft1-in99.6%
+-commutative99.6%
+-commutative99.6%
distribute-lft1-in99.6%
*-commutative99.6%
mul-1-neg99.6%
log-rec99.6%
remove-double-neg99.6%
Simplified55.9%
if -5.6000000000000002e125 < z < -1.2e64Initial program 92.4%
remove-double-neg92.4%
remove-double-neg92.4%
sub-neg92.4%
metadata-eval92.4%
*-commutative92.4%
fma-def92.4%
fma-neg92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in y around 0 58.7%
Taylor expanded in x around 0 50.7%
Taylor expanded in z around inf 50.5%
unpow250.5%
associate-/l*50.5%
Simplified50.5%
if -1.2e64 < z < 3.20000000000000002e42Initial program 97.1%
remove-double-neg97.1%
remove-double-neg97.1%
sub-neg97.1%
metadata-eval97.1%
*-commutative97.1%
fma-def97.1%
fma-neg97.1%
metadata-eval97.1%
Simplified97.1%
Taylor expanded in z around 0 89.0%
associate-+l-89.0%
metadata-eval89.0%
sub-neg89.0%
*-commutative89.0%
sub-neg89.0%
metadata-eval89.0%
sub-neg89.0%
metadata-eval89.0%
Applied egg-rr89.0%
Final simplification77.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -520000000.0) (not (<= z 1.6e-10)))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ z (/ x z))))
(+
(+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -520000000.0) || !(z <= 1.6e-10)) {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + (z * -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) :: tmp
if ((z <= (-520000000.0d0)) .or. (.not. (z <= 1.6d-10))) then
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (z / (x / z)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x + (-0.5d0))) - x)) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -520000000.0) || !(z <= 1.6e-10)) {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -520000000.0) or not (z <= 1.6e-10): tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))) else: tmp = (0.91893853320467 + ((math.log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -520000000.0) || !(z <= 1.6e-10)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -520000000.0) || ~((z <= 1.6e-10))) tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))); else tmp = (0.91893853320467 + ((log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -520000000.0], N[Not[LessEqual[z, 1.6e-10]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -520000000 \lor \neg \left(z \leq 1.6 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\end{array}
\end{array}
if z < -5.2e8 or 1.5999999999999999e-10 < z Initial program 85.0%
remove-double-neg85.0%
remove-double-neg85.0%
sub-neg85.0%
metadata-eval85.0%
*-commutative85.0%
fma-def85.0%
fma-neg85.0%
metadata-eval85.0%
Simplified85.0%
clear-num84.9%
metadata-eval84.9%
fma-neg84.9%
fma-udef84.9%
*-commutative84.9%
inv-pow84.9%
*-commutative84.9%
fma-udef84.9%
fma-neg84.9%
metadata-eval84.9%
fma-udef84.9%
*-commutative84.9%
fma-def84.9%
Applied egg-rr84.9%
Taylor expanded in z around inf 84.7%
associate-/l*91.3%
associate-/r/92.0%
unpow292.0%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in x around inf 99.5%
*-commutative99.5%
sub-neg99.5%
*-commutative99.5%
metadata-eval99.5%
distribute-lft1-in99.5%
+-commutative99.5%
+-commutative99.5%
distribute-lft1-in99.5%
*-commutative99.5%
mul-1-neg99.5%
log-rec99.5%
remove-double-neg99.5%
Simplified99.5%
if -5.2e8 < z < 1.5999999999999999e-10Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
fma-def99.4%
fma-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.8%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(if (or (<= z -4400.0) (not (<= z 6.5e-35)))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ z (/ x z))))
(+
(- (* (log x) (+ x -0.5)) (+ x -0.91893853320467))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4400.0) || !(z <= 6.5e-35)) {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
} else {
tmp = ((log(x) * (x + -0.5)) - (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 <= (-4400.0d0)) .or. (.not. (z <= 6.5d-35))) then
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (z / (x / z)))
else
tmp = ((log(x) * (x + (-0.5d0))) - (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 <= -4400.0) || !(z <= 6.5e-35)) {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
} else {
tmp = ((Math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4400.0) or not (z <= 6.5e-35): tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))) else: tmp = ((math.log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4400.0) || !(z <= 6.5e-35)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); else tmp = Float64(Float64(Float64(log(x) * Float64(x + -0.5)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4400.0) || ~((z <= 6.5e-35))) tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z))); else tmp = ((log(x) * (x + -0.5)) - (x + -0.91893853320467)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4400.0], N[Not[LessEqual[z, 6.5e-35]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4400 \lor \neg \left(z \leq 6.5 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -4400 or 6.4999999999999999e-35 < z Initial program 85.8%
remove-double-neg85.8%
remove-double-neg85.8%
sub-neg85.8%
metadata-eval85.8%
*-commutative85.8%
fma-def85.8%
fma-neg85.8%
metadata-eval85.8%
Simplified85.8%
clear-num85.8%
metadata-eval85.8%
fma-neg85.8%
fma-udef85.8%
*-commutative85.8%
inv-pow85.8%
*-commutative85.8%
fma-udef85.8%
fma-neg85.8%
metadata-eval85.8%
fma-udef85.8%
*-commutative85.8%
fma-def85.8%
Applied egg-rr85.8%
Taylor expanded in z around inf 84.9%
associate-/l*90.5%
associate-/r/91.8%
unpow291.8%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around inf 98.7%
*-commutative98.7%
sub-neg98.7%
*-commutative98.7%
metadata-eval98.7%
distribute-lft1-in98.7%
+-commutative98.7%
+-commutative98.7%
distribute-lft1-in98.7%
*-commutative98.7%
mul-1-neg98.7%
log-rec98.7%
remove-double-neg98.7%
Simplified98.7%
if -4400 < z < 6.4999999999999999e-35Initial program 99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
*-commutative99.4%
fma-def99.4%
fma-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.2%
associate-+l-97.2%
metadata-eval97.2%
sub-neg97.2%
*-commutative97.2%
sub-neg97.2%
metadata-eval97.2%
sub-neg97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Final simplification98.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -8.5e+223) (not (<= z 5.4e+90)))
(+
(+ 0.91893853320467 (* (log x) -0.5))
(* 0.0007936500793651 (/ z (/ x z))))
(+
(* x (+ (log x) -1.0))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e+223) || !(z <= 5.4e+90)) {
tmp = (0.91893853320467 + (log(x) * -0.5)) + (0.0007936500793651 * (z / (x / z)));
} else {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -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) :: tmp
if ((z <= (-8.5d+223)) .or. (.not. (z <= 5.4d+90))) then
tmp = (0.91893853320467d0 + (log(x) * (-0.5d0))) + (0.0007936500793651d0 * (z / (x / z)))
else
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e+223) || !(z <= 5.4e+90)) {
tmp = (0.91893853320467 + (Math.log(x) * -0.5)) + (0.0007936500793651 * (z / (x / z)));
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8.5e+223) or not (z <= 5.4e+90): tmp = (0.91893853320467 + (math.log(x) * -0.5)) + (0.0007936500793651 * (z / (x / z))) else: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8.5e+223) || !(z <= 5.4e+90)) tmp = Float64(Float64(0.91893853320467 + Float64(log(x) * -0.5)) + Float64(0.0007936500793651 * Float64(z / Float64(x / z)))); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -8.5e+223) || ~((z <= 5.4e+90))) tmp = (0.91893853320467 + (log(x) * -0.5)) + (0.0007936500793651 * (z / (x / z))); else tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.5e+223], N[Not[LessEqual[z, 5.4e+90]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(0.0007936500793651 * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+223} \lor \neg \left(z \leq 5.4 \cdot 10^{+90}\right):\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + 0.0007936500793651 \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\end{array}
\end{array}
if z < -8.5000000000000005e223 or 5.4e90 < z Initial program 94.9%
remove-double-neg94.9%
remove-double-neg94.9%
sub-neg94.9%
metadata-eval94.9%
*-commutative94.9%
fma-def94.9%
fma-neg94.9%
metadata-eval94.9%
Simplified94.9%
Taylor expanded in y around 0 69.1%
Taylor expanded in x around 0 69.0%
Taylor expanded in z around inf 69.0%
unpow269.0%
associate-/l*67.2%
Simplified67.2%
if -8.5000000000000005e223 < z < 5.4e90Initial program 91.7%
remove-double-neg91.7%
remove-double-neg91.7%
sub-neg91.7%
metadata-eval91.7%
*-commutative91.7%
fma-def91.7%
fma-neg91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around 0 79.8%
Taylor expanded in x around inf 77.7%
*-commutative66.6%
sub-neg66.6%
*-commutative66.6%
metadata-eval66.6%
distribute-lft1-in66.6%
+-commutative66.6%
+-commutative66.6%
distribute-lft1-in66.6%
*-commutative66.6%
mul-1-neg66.6%
log-rec66.6%
remove-double-neg66.6%
Simplified77.7%
Final simplification75.5%
(FPCore (x y z)
:precision binary64
(if (or (<= z -8.5e+223) (not (<= z 2.85e+91)))
(+
(+ 0.91893853320467 (* (log x) -0.5))
(* 0.0007936500793651 (/ (* z z) x)))
(+
(* x (+ (log x) -1.0))
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e+223) || !(z <= 2.85e+91)) {
tmp = (0.91893853320467 + (log(x) * -0.5)) + (0.0007936500793651 * ((z * z) / x));
} else {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -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) :: tmp
if ((z <= (-8.5d+223)) .or. (.not. (z <= 2.85d+91))) then
tmp = (0.91893853320467d0 + (log(x) * (-0.5d0))) + (0.0007936500793651d0 * ((z * z) / x))
else
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -8.5e+223) || !(z <= 2.85e+91)) {
tmp = (0.91893853320467 + (Math.log(x) * -0.5)) + (0.0007936500793651 * ((z * z) / x));
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8.5e+223) or not (z <= 2.85e+91): tmp = (0.91893853320467 + (math.log(x) * -0.5)) + (0.0007936500793651 * ((z * z) / x)) else: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8.5e+223) || !(z <= 2.85e+91)) tmp = Float64(Float64(0.91893853320467 + Float64(log(x) * -0.5)) + Float64(0.0007936500793651 * Float64(Float64(z * z) / x))); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -8.5e+223) || ~((z <= 2.85e+91))) tmp = (0.91893853320467 + (log(x) * -0.5)) + (0.0007936500793651 * ((z * z) / x)); else tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.5e+223], N[Not[LessEqual[z, 2.85e+91]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(0.0007936500793651 * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+223} \lor \neg \left(z \leq 2.85 \cdot 10^{+91}\right):\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + 0.0007936500793651 \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\end{array}
\end{array}
if z < -8.5000000000000005e223 or 2.84999999999999982e91 < z Initial program 94.9%
remove-double-neg94.9%
remove-double-neg94.9%
sub-neg94.9%
metadata-eval94.9%
*-commutative94.9%
fma-def94.9%
fma-neg94.9%
metadata-eval94.9%
Simplified94.9%
Taylor expanded in y around 0 69.1%
Taylor expanded in x around 0 69.0%
Taylor expanded in z around inf 69.0%
unpow269.0%
Simplified69.0%
if -8.5000000000000005e223 < z < 2.84999999999999982e91Initial program 91.7%
remove-double-neg91.7%
remove-double-neg91.7%
sub-neg91.7%
metadata-eval91.7%
*-commutative91.7%
fma-def91.7%
fma-neg91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around 0 79.8%
Taylor expanded in x around inf 77.7%
*-commutative66.6%
sub-neg66.6%
*-commutative66.6%
metadata-eval66.6%
distribute-lft1-in66.6%
+-commutative66.6%
+-commutative66.6%
distribute-lft1-in66.6%
*-commutative66.6%
mul-1-neg66.6%
log-rec66.6%
remove-double-neg66.6%
Simplified77.7%
Final simplification75.9%
(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.4%
remove-double-neg92.4%
remove-double-neg92.4%
sub-neg92.4%
metadata-eval92.4%
*-commutative92.4%
fma-def92.4%
fma-neg92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in z around 0 65.8%
Taylor expanded in x around inf 64.1%
*-commutative73.6%
sub-neg73.6%
*-commutative73.6%
metadata-eval73.6%
distribute-lft1-in73.6%
+-commutative73.6%
+-commutative73.6%
distribute-lft1-in73.6%
*-commutative73.6%
mul-1-neg73.6%
log-rec73.6%
remove-double-neg73.6%
Simplified64.1%
Final simplification64.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 92.4%
remove-double-neg92.4%
remove-double-neg92.4%
sub-neg92.4%
metadata-eval92.4%
*-commutative92.4%
fma-def92.4%
fma-neg92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in z around 0 61.9%
Taylor expanded in x around inf 60.3%
*-commutative73.6%
sub-neg73.6%
*-commutative73.6%
metadata-eval73.6%
distribute-lft1-in73.6%
+-commutative73.6%
+-commutative73.6%
distribute-lft1-in73.6%
*-commutative73.6%
mul-1-neg73.6%
log-rec73.6%
remove-double-neg73.6%
Simplified60.3%
Final simplification60.3%
(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 2023199
(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)))