
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (<= x 0.08)
(+
t_0
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x))
(+ t_0 (* (+ y 0.0007936500793651) (/ z (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 0.08) {
tmp = t_0 + (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 0.08) tmp = Float64(t_0 + Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x)); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 0.08], N[(t$95$0 + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 0.08:\\
\;\;\;\;t_0 + \frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 0.0800000000000000017Initial program 99.7%
sub-neg99.7%
metadata-eval99.7%
fma-def99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 0.0800000000000000017 < x Initial program 84.7%
sub-neg84.7%
metadata-eval84.7%
fma-def84.7%
fma-neg84.7%
metadata-eval84.7%
Simplified84.7%
metadata-eval84.7%
fma-neg84.7%
fma-def84.7%
clear-num84.6%
inv-pow84.6%
*-commutative84.6%
fma-udef84.6%
fma-neg84.6%
metadata-eval84.6%
Applied egg-rr84.6%
Taylor expanded in z around inf 83.9%
*-commutative83.9%
associate-*r/88.1%
unpow288.1%
associate-/l*99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 0.08)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778)))
x))
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(* (+ y 0.0007936500793651) (/ z (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.08) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + ((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 <= 0.08d0) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0))) / x)
else
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + ((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 <= 0.08) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x);
} else {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.08: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x) else: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * (z / (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.08) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + 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 <= 0.08) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * (((y + 0.0007936500793651) * z) - 0.0027777777777778))) / x); else tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * (z / (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.08], 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[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.08:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if x < 0.0800000000000000017Initial program 99.7%
if 0.0800000000000000017 < x Initial program 84.7%
sub-neg84.7%
metadata-eval84.7%
fma-def84.7%
fma-neg84.7%
metadata-eval84.7%
Simplified84.7%
metadata-eval84.7%
fma-neg84.7%
fma-def84.7%
clear-num84.6%
inv-pow84.6%
*-commutative84.6%
fma-udef84.6%
fma-neg84.6%
metadata-eval84.6%
Applied egg-rr84.6%
Taylor expanded in z around inf 83.9%
*-commutative83.9%
associate-*r/88.1%
unpow288.1%
associate-/l*99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (or (<= z -7e-31) (not (<= z 1.85e-62)))
(+ t_0 (* (+ y 0.0007936500793651) (* z (/ z x))))
(+ t_0 (* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -7e-31) || !(z <= 1.85e-62)) {
tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
} else {
tmp = t_0 + (0.083333333333333 * (1.0 / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if ((z <= (-7d-31)) .or. (.not. (z <= 1.85d-62))) then
tmp = t_0 + ((y + 0.0007936500793651d0) * (z * (z / x)))
else
tmp = t_0 + (0.083333333333333d0 * (1.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if ((z <= -7e-31) || !(z <= 1.85e-62)) {
tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
} else {
tmp = t_0 + (0.083333333333333 * (1.0 / x));
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if (z <= -7e-31) or not (z <= 1.85e-62): tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x))) else: tmp = t_0 + (0.083333333333333 * (1.0 / x)) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if ((z <= -7e-31) || !(z <= 1.85e-62)) tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x)))); else tmp = Float64(t_0 + Float64(0.083333333333333 * Float64(1.0 / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if ((z <= -7e-31) || ~((z <= 1.85e-62))) tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x))); else tmp = t_0 + (0.083333333333333 * (1.0 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[Or[LessEqual[z, -7e-31], N[Not[LessEqual[z, 1.85e-62]], $MachinePrecision]], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;z \leq -7 \cdot 10^{-31} \lor \neg \left(z \leq 1.85 \cdot 10^{-62}\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + 0.083333333333333 \cdot \frac{1}{x}\\
\end{array}
\end{array}
if z < -6.99999999999999971e-31 or 1.8499999999999999e-62 < z Initial program 88.6%
sub-neg88.6%
metadata-eval88.6%
fma-def88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
metadata-eval88.6%
fma-neg88.6%
fma-def88.6%
clear-num88.6%
inv-pow88.6%
*-commutative88.6%
fma-udef88.6%
fma-neg88.6%
metadata-eval88.6%
Applied egg-rr88.6%
Taylor expanded in x around 0 88.6%
Taylor expanded in z around inf 74.2%
+-commutative74.2%
associate-*l/77.3%
unpow277.3%
*-commutative77.3%
fma-def77.3%
associate-/l*85.9%
associate-/r/85.9%
Simplified85.9%
Taylor expanded in z around inf 86.7%
+-commutative86.7%
distribute-rgt-in67.1%
associate-*l/65.6%
*-commutative65.6%
unpow265.6%
associate-*r*66.9%
associate-*l/70.4%
associate-*r*69.3%
*-commutative69.3%
associate-*r/69.3%
metadata-eval69.3%
associate-*l/69.3%
associate-*r/69.3%
*-commutative69.3%
unpow269.3%
associate-*r/78.9%
distribute-lft-in96.1%
*-commutative96.1%
+-commutative96.1%
Simplified96.1%
if -6.99999999999999971e-31 < z < 1.8499999999999999e-62Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.2%
div-inv94.2%
Applied egg-rr94.2%
Final simplification95.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)))
(if (<= z -6.8e-31)
(+ t_0 (* (+ y 0.0007936500793651) (/ z (/ x z))))
(if (<= z 2.2e-62)
(+ t_0 (* 0.083333333333333 (/ 1.0 x)))
(+ t_0 (* (+ y 0.0007936500793651) (* z (/ z x))))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (z <= -6.8e-31) {
tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
} else if (z <= 2.2e-62) {
tmp = t_0 + (0.083333333333333 * (1.0 / x));
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / 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 + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0
if (z <= (-6.8d-31)) then
tmp = t_0 + ((y + 0.0007936500793651d0) * (z / (x / z)))
else if (z <= 2.2d-62) then
tmp = t_0 + (0.083333333333333d0 * (1.0d0 / x))
else
tmp = t_0 + ((y + 0.0007936500793651d0) * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if (z <= -6.8e-31) {
tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
} else if (z <= 2.2e-62) {
tmp = t_0 + (0.083333333333333 * (1.0 / x));
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if z <= -6.8e-31: tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z))) elif z <= 2.2e-62: tmp = t_0 + (0.083333333333333 * (1.0 / x)) else: tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (z <= -6.8e-31) tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z)))); elseif (z <= 2.2e-62) tmp = Float64(t_0 + Float64(0.083333333333333 * Float64(1.0 / x))); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if (z <= -6.8e-31) tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z))); elseif (z <= 2.2e-62) tmp = t_0 + (0.083333333333333 * (1.0 / x)); else tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[z, -6.8e-31], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-62], N[(t$95$0 + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-31}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-62}:\\
\;\;\;\;t_0 + 0.083333333333333 \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if z < -6.8000000000000002e-31Initial program 85.1%
sub-neg85.1%
metadata-eval85.1%
fma-def85.1%
fma-neg85.1%
metadata-eval85.1%
Simplified85.1%
metadata-eval85.1%
fma-neg85.1%
fma-def85.1%
clear-num85.0%
inv-pow85.0%
*-commutative85.0%
fma-udef85.0%
fma-neg85.1%
metadata-eval85.1%
Applied egg-rr85.1%
Taylor expanded in z around inf 83.0%
*-commutative83.0%
associate-*r/86.6%
unpow286.6%
associate-/l*97.6%
Simplified97.6%
if -6.8000000000000002e-31 < z < 2.20000000000000017e-62Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.2%
div-inv94.2%
Applied egg-rr94.2%
if 2.20000000000000017e-62 < z Initial program 91.4%
sub-neg91.4%
metadata-eval91.4%
fma-def91.4%
fma-neg91.4%
metadata-eval91.4%
Simplified91.4%
metadata-eval91.4%
fma-neg91.4%
fma-def91.4%
clear-num91.4%
inv-pow91.4%
*-commutative91.4%
fma-udef91.3%
fma-neg91.3%
metadata-eval91.3%
Applied egg-rr91.3%
Taylor expanded in x around 0 91.4%
Taylor expanded in z around inf 71.3%
+-commutative71.3%
associate-*l/74.1%
unpow274.1%
*-commutative74.1%
fma-def74.1%
associate-/l*80.7%
associate-/r/80.7%
Simplified80.7%
Taylor expanded in z around inf 86.7%
+-commutative86.7%
distribute-rgt-in66.9%
associate-*l/67.0%
*-commutative67.0%
unpow267.0%
associate-*r*68.0%
associate-*l/70.0%
associate-*r*70.1%
*-commutative70.1%
associate-*r/70.1%
metadata-eval70.1%
associate-*l/70.1%
associate-*r/70.1%
*-commutative70.1%
unpow270.1%
associate-*r/78.7%
distribute-lft-in95.0%
*-commutative95.0%
+-commutative95.0%
Simplified95.0%
Final simplification95.5%
(FPCore (x y z)
:precision binary64
(if (or (<= z -6.8e-31) (not (<= z 1.85e-62)))
(+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ (* z z) x)))
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.8e-31) || !(z <= 1.85e-62)) {
tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-6.8d-31)) .or. (.not. (z <= 1.85d-62))) then
tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * ((z * z) / x))
else
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6.8e-31) || !(z <= 1.85e-62)) {
tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x));
} else {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.8e-31) or not (z <= 1.85e-62): tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x)) else: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.8e-31) || !(z <= 1.85e-62)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); else tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.8e-31) || ~((z <= 1.85e-62))) tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * ((z * z) / x)); 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, -6.8e-31], N[Not[LessEqual[z, 1.85e-62]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $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 -6.8 \cdot 10^{-31} \lor \neg \left(z \leq 1.85 \cdot 10^{-62}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -6.8000000000000002e-31 or 1.8499999999999999e-62 < z Initial program 88.6%
sub-neg88.6%
metadata-eval88.6%
fma-def88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in z around inf 84.4%
associate-/l*86.7%
unpow286.7%
Simplified86.7%
Taylor expanded in x around inf 86.6%
sub-neg25.3%
mul-1-neg25.3%
log-rec25.3%
remove-double-neg25.3%
metadata-eval25.3%
Simplified86.6%
associate-/r/87.5%
+-commutative87.5%
Applied egg-rr87.5%
if -6.8000000000000002e-31 < z < 1.8499999999999999e-62Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.2%
Final simplification89.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= z -7e-31)
(+ t_0 (/ (* z z) (/ x (+ y 0.0007936500793651))))
(if (<= z 7.5e-63)
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))
(+ t_0 (* (+ y 0.0007936500793651) (/ (* z z) x)))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (z <= -7e-31) {
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651)));
} else if (z <= 7.5e-63) {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / 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 (z <= (-7d-31)) then
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651d0)))
else if (z <= 7.5d-63) then
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
else
tmp = t_0 + ((y + 0.0007936500793651d0) * ((z * z) / 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 (z <= -7e-31) {
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651)));
} else if (z <= 7.5e-63) {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if z <= -7e-31: tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651))) elif z <= 7.5e-63: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) else: tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (z <= -7e-31) tmp = Float64(t_0 + Float64(Float64(z * z) / Float64(x / Float64(y + 0.0007936500793651)))); elseif (z <= 7.5e-63) tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (z <= -7e-31) tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651))); elseif (z <= 7.5e-63) tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); else tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / 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[LessEqual[z, -7e-31], N[(t$95$0 + N[(N[(z * z), $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-63], 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], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{-31}:\\
\;\;\;\;t_0 + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-63}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\end{array}
\end{array}
if z < -6.99999999999999971e-31Initial program 85.1%
sub-neg85.1%
metadata-eval85.1%
fma-def85.1%
fma-neg85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in z around inf 83.0%
associate-/l*86.6%
unpow286.6%
Simplified86.6%
Taylor expanded in x around inf 86.6%
sub-neg24.0%
mul-1-neg24.0%
log-rec24.0%
remove-double-neg24.0%
metadata-eval24.0%
Simplified86.6%
if -6.99999999999999971e-31 < z < 7.5000000000000003e-63Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.2%
if 7.5000000000000003e-63 < z Initial program 91.4%
sub-neg91.4%
metadata-eval91.4%
fma-def91.4%
fma-neg91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in z around inf 85.6%
associate-/l*86.7%
unpow286.7%
Simplified86.7%
Taylor expanded in x around inf 86.7%
sub-neg26.3%
mul-1-neg26.3%
log-rec26.3%
remove-double-neg26.3%
metadata-eval26.3%
Simplified86.7%
associate-/r/88.2%
+-commutative88.2%
Applied egg-rr88.2%
Final simplification89.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= z -7e-31)
(+ t_0 (/ (* z z) (/ x (+ y 0.0007936500793651))))
(if (<= z 8e-63)
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(* 0.083333333333333 (/ 1.0 x)))
(+ t_0 (* (+ y 0.0007936500793651) (/ (* z z) x)))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (z <= -7e-31) {
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651)));
} else if (z <= 8e-63) {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / x));
} else {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / 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 (z <= (-7d-31)) then
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651d0)))
else if (z <= 8d-63) then
tmp = ((((x + (-0.5d0)) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 * (1.0d0 / x))
else
tmp = t_0 + ((y + 0.0007936500793651d0) * ((z * z) / 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 (z <= -7e-31) {
tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651)));
} else if (z <= 8e-63) {
tmp = ((((x + -0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / x));
} else {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if z <= -7e-31: tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651))) elif z <= 8e-63: tmp = ((((x + -0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / x)) else: tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / x)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (z <= -7e-31) tmp = Float64(t_0 + Float64(Float64(z * z) / Float64(x / Float64(y + 0.0007936500793651)))); elseif (z <= 8e-63) tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 * Float64(1.0 / x))); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (z <= -7e-31) tmp = t_0 + ((z * z) / (x / (y + 0.0007936500793651))); elseif (z <= 8e-63) tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / x)); else tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) / 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[LessEqual[z, -7e-31], N[(t$95$0 + N[(N[(z * z), $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-63], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{-31}:\\
\;\;\;\;t_0 + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-63}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + 0.083333333333333 \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\end{array}
\end{array}
if z < -6.99999999999999971e-31Initial program 85.1%
sub-neg85.1%
metadata-eval85.1%
fma-def85.1%
fma-neg85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in z around inf 83.0%
associate-/l*86.6%
unpow286.6%
Simplified86.6%
Taylor expanded in x around inf 86.6%
sub-neg24.0%
mul-1-neg24.0%
log-rec24.0%
remove-double-neg24.0%
metadata-eval24.0%
Simplified86.6%
if -6.99999999999999971e-31 < z < 8.00000000000000053e-63Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 94.2%
div-inv94.2%
Applied egg-rr94.2%
if 8.00000000000000053e-63 < z Initial program 91.4%
sub-neg91.4%
metadata-eval91.4%
fma-def91.4%
fma-neg91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in z around inf 85.6%
associate-/l*86.7%
unpow286.7%
Simplified86.7%
Taylor expanded in x around inf 86.7%
sub-neg26.3%
mul-1-neg26.3%
log-rec26.3%
remove-double-neg26.3%
metadata-eval26.3%
Simplified86.7%
associate-/r/88.2%
+-commutative88.2%
Applied egg-rr88.2%
Final simplification89.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= z -2.5e-8) (not (<= z 5.2e-13)))
(+ t_0 (* 0.0007936500793651 (/ z (/ x z))))
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((z <= -2.5e-8) || !(z <= 5.2e-13)) {
tmp = t_0 + (0.0007936500793651 * (z / (x / z)));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if ((z <= (-2.5d-8)) .or. (.not. (z <= 5.2d-13))) then
tmp = t_0 + (0.0007936500793651d0 * (z / (x / z)))
else
tmp = t_0 + (0.083333333333333d0 / 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 ((z <= -2.5e-8) || !(z <= 5.2e-13)) {
tmp = t_0 + (0.0007936500793651 * (z / (x / z)));
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (z <= -2.5e-8) or not (z <= 5.2e-13): tmp = t_0 + (0.0007936500793651 * (z / (x / z))) else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((z <= -2.5e-8) || !(z <= 5.2e-13)) tmp = Float64(t_0 + Float64(0.0007936500793651 * Float64(z / Float64(x / z)))); else tmp = Float64(t_0 + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((z <= -2.5e-8) || ~((z <= 5.2e-13))) tmp = t_0 + (0.0007936500793651 * (z / (x / z))); else tmp = t_0 + (0.083333333333333 / 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[z, -2.5e-8], N[Not[LessEqual[z, 5.2e-13]], $MachinePrecision]], N[(t$95$0 + N[(0.0007936500793651 * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-8} \lor \neg \left(z \leq 5.2 \cdot 10^{-13}\right):\\
\;\;\;\;t_0 + 0.0007936500793651 \cdot \frac{z}{\frac{x}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.4999999999999999e-8 or 5.2000000000000001e-13 < z Initial program 87.4%
sub-neg87.4%
metadata-eval87.4%
fma-def87.4%
fma-neg87.5%
metadata-eval87.5%
Simplified87.5%
Taylor expanded in z around inf 86.0%
associate-/l*89.5%
unpow289.5%
Simplified89.5%
Taylor expanded in x around inf 89.5%
sub-neg24.1%
mul-1-neg24.1%
log-rec24.1%
remove-double-neg24.1%
metadata-eval24.1%
Simplified89.5%
Taylor expanded in y around 0 62.5%
unpow262.5%
associate-/l*68.9%
Simplified68.9%
if -2.4999999999999999e-8 < z < 5.2000000000000001e-13Initial program 99.5%
sub-neg99.5%
metadata-eval99.5%
fma-def99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 85.0%
Taylor expanded in x around inf 82.8%
sub-neg82.8%
mul-1-neg82.8%
log-rec82.8%
remove-double-neg82.8%
metadata-eval82.8%
Simplified82.8%
Final simplification74.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -0.0008) (not (<= y 1.65e-9)))
(+ t_0 (* z (* z (/ y x))))
(+ t_0 (* 0.0007936500793651 (/ z (/ x z)))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((y <= -0.0008) || !(y <= 1.65e-9)) {
tmp = t_0 + (z * (z * (y / x)));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if ((y <= (-0.0008d0)) .or. (.not. (y <= 1.65d-9))) then
tmp = t_0 + (z * (z * (y / x)))
else
tmp = t_0 + (0.0007936500793651d0 * (z / (x / 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 ((y <= -0.0008) || !(y <= 1.65e-9)) {
tmp = t_0 + (z * (z * (y / x)));
} else {
tmp = t_0 + (0.0007936500793651 * (z / (x / z)));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (y <= -0.0008) or not (y <= 1.65e-9): tmp = t_0 + (z * (z * (y / x))) else: tmp = t_0 + (0.0007936500793651 * (z / (x / z))) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((y <= -0.0008) || !(y <= 1.65e-9)) tmp = Float64(t_0 + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(t_0 + Float64(0.0007936500793651 * Float64(z / Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((y <= -0.0008) || ~((y <= 1.65e-9))) tmp = t_0 + (z * (z * (y / x))); else tmp = t_0 + (0.0007936500793651 * (z / (x / 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[Or[LessEqual[y, -0.0008], N[Not[LessEqual[y, 1.65e-9]], $MachinePrecision]], N[(t$95$0 + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(0.0007936500793651 * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -0.0008 \lor \neg \left(y \leq 1.65 \cdot 10^{-9}\right):\\
\;\;\;\;t_0 + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + 0.0007936500793651 \cdot \frac{z}{\frac{x}{z}}\\
\end{array}
\end{array}
if y < -8.00000000000000038e-4 or 1.65000000000000009e-9 < y Initial program 92.8%
sub-neg92.8%
metadata-eval92.8%
fma-def92.8%
fma-neg92.8%
metadata-eval92.8%
Simplified92.8%
metadata-eval92.8%
fma-neg92.8%
fma-def92.8%
clear-num92.8%
inv-pow92.8%
*-commutative92.8%
fma-udef92.8%
fma-neg92.8%
metadata-eval92.8%
Applied egg-rr92.8%
Taylor expanded in y around inf 76.7%
*-commutative76.7%
associate-*r/77.2%
unpow277.2%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in x around inf 80.1%
sub-neg41.6%
mul-1-neg41.6%
log-rec41.6%
remove-double-neg41.6%
metadata-eval41.6%
Simplified80.1%
if -8.00000000000000038e-4 < y < 1.65000000000000009e-9Initial program 91.2%
sub-neg91.2%
metadata-eval91.2%
fma-def91.2%
fma-neg91.2%
metadata-eval91.2%
Simplified91.2%
Taylor expanded in z around inf 76.2%
associate-/l*76.2%
unpow276.2%
Simplified76.2%
Taylor expanded in x around inf 75.7%
sub-neg53.9%
mul-1-neg53.9%
log-rec53.9%
remove-double-neg53.9%
metadata-eval53.9%
Simplified75.7%
Taylor expanded in y around 0 75.7%
unpow275.7%
associate-/l*85.0%
Simplified85.0%
Final simplification82.2%
(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.1%
sub-neg92.1%
metadata-eval92.1%
fma-def92.1%
fma-neg92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in z around 0 47.6%
Taylor expanded in x around inf 46.8%
sub-neg46.8%
mul-1-neg46.8%
log-rec46.8%
remove-double-neg46.8%
metadata-eval46.8%
Simplified46.8%
Final simplification46.8%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 92.1%
sub-neg92.1%
metadata-eval92.1%
fma-def92.1%
fma-neg92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in z around 0 47.6%
Taylor expanded in x around 0 16.8%
Taylor expanded in x around 0 17.3%
Final simplification17.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 2023297
(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)))