
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 61000.0)
(+
(pow (sqrt (fma (+ x -0.5) (log x) (- 0.91893853320467 x))) 2.0)
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ z (/ (/ x (+ y 0.0007936500793651)) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 61000.0) {
tmp = pow(sqrt(fma((x + -0.5), log(x), (0.91893853320467 - x))), 2.0) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z / ((x / (y + 0.0007936500793651)) / z));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 61000.0) tmp = Float64((sqrt(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x))) ^ 2.0) + Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z / Float64(Float64(x / Float64(y + 0.0007936500793651)) / z))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 61000.0], N[(N[Power[N[Sqrt[N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z / N[(N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 61000:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)}\right)}^{2} + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{z}{\frac{\frac{x}{y + 0.0007936500793651}}{z}}\\
\end{array}
\end{array}
if x < 61000Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
+-commutative99.7%
sub-neg99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
add-sqr-sqrt99.7%
pow299.7%
Applied egg-rr99.7%
if 61000 < x Initial program 89.6%
Taylor expanded in z around inf 89.6%
associate-/l*91.8%
Simplified91.8%
unpow291.8%
div-inv91.8%
times-frac97.3%
+-commutative97.3%
Applied egg-rr97.3%
frac-times91.8%
associate-/l*99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= (+ y 0.0007936500793651) -500000.0)
(not (<= (+ y 0.0007936500793651) 0.000794)))
(+ t_0 (/ (+ 0.083333333333333 (* z (- (* y z) 0.0027777777777778))) x))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (((y + 0.0007936500793651) <= -500000.0) || !((y + 0.0007936500793651) <= 0.000794)) {
tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * 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 = x * (log(x) + (-1.0d0))
if (((y + 0.0007936500793651d0) <= (-500000.0d0)) .or. (.not. ((y + 0.0007936500793651d0) <= 0.000794d0))) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((y * z) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (((y + 0.0007936500793651) <= -500000.0) || !((y + 0.0007936500793651) <= 0.000794)) {
tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if ((y + 0.0007936500793651) <= -500000.0) or not ((y + 0.0007936500793651) <= 0.000794): tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x) else: tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((Float64(y + 0.0007936500793651) <= -500000.0) || !(Float64(y + 0.0007936500793651) <= 0.000794)) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(y * z) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (((y + 0.0007936500793651) <= -500000.0) || ~(((y + 0.0007936500793651) <= 0.000794))) tmp = t_0 + ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x); else tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -500000.0], N[Not[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.000794]], $MachinePrecision]], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(y * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y + 0.0007936500793651 \leq -500000 \lor \neg \left(y + 0.0007936500793651 \leq 0.000794\right):\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(y \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if (+.f64 y 7936500793651/10000000000000000) < -5e5 or 7.94e-4 < (+.f64 y 7936500793651/10000000000000000) Initial program 95.9%
Taylor expanded in x around inf 94.7%
sub-neg50.3%
mul-1-neg50.3%
log-rec50.3%
remove-double-neg50.3%
metadata-eval50.3%
Simplified94.7%
Taylor expanded in y around inf 94.4%
*-commutative94.4%
Simplified94.4%
if -5e5 < (+.f64 y 7936500793651/10000000000000000) < 7.94e-4Initial program 93.3%
Taylor expanded in x around inf 93.2%
sub-neg69.6%
mul-1-neg69.6%
log-rec69.6%
remove-double-neg69.6%
metadata-eval69.6%
Simplified93.2%
Taylor expanded in y around 0 92.9%
Final simplification93.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 61000.0)
(+
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
t_0)
(+ t_0 (/ z (/ (/ x (+ y 0.0007936500793651)) z))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 61000.0) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 61000.0d0) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + t_0
else
tmp = t_0 + (z / ((x / (y + 0.0007936500793651d0)) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 61000.0) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 61000.0: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0 else: tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z)) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 61000.0) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0); else tmp = Float64(t_0 + Float64(z / Float64(Float64(x / Float64(y + 0.0007936500793651)) / z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 61000.0) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0; else tmp = t_0 + (z / ((x / (y + 0.0007936500793651)) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 61000.0], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(z / N[(N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 61000:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{z}{\frac{\frac{x}{y + 0.0007936500793651}}{z}}\\
\end{array}
\end{array}
if x < 61000Initial program 99.7%
if 61000 < x Initial program 89.6%
Taylor expanded in z around inf 89.6%
associate-/l*91.8%
Simplified91.8%
unpow291.8%
div-inv91.8%
times-frac97.3%
+-commutative97.3%
Applied egg-rr97.3%
frac-times91.8%
associate-/l*99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= y -9.5e+80) (not (<= y 7e+161)))
(+ t_0 (* z (* z (/ y x))))
(+
t_0
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((y <= -9.5e+80) || !(y <= 7e+161)) {
tmp = t_0 + (z * (z * (y / x)));
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * 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 = x * (log(x) + (-1.0d0))
if ((y <= (-9.5d+80)) .or. (.not. (y <= 7d+161))) then
tmp = t_0 + (z * (z * (y / x)))
else
tmp = t_0 + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((y <= -9.5e+80) || !(y <= 7e+161)) {
tmp = t_0 + (z * (z * (y / x)));
} else {
tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (y <= -9.5e+80) or not (y <= 7e+161): tmp = t_0 + (z * (z * (y / x))) else: tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((y <= -9.5e+80) || !(y <= 7e+161)) tmp = Float64(t_0 + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((y <= -9.5e+80) || ~((y <= 7e+161))) tmp = t_0 + (z * (z * (y / x))); else tmp = t_0 + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -9.5e+80], N[Not[LessEqual[y, 7e+161]], $MachinePrecision]], N[(t$95$0 + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+80} \lor \neg \left(y \leq 7 \cdot 10^{+161}\right):\\
\;\;\;\;t_0 + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -9.499999999999999e80 or 6.99999999999999976e161 < y Initial program 94.5%
Taylor expanded in y around inf 76.9%
associate-/l*80.8%
Simplified80.8%
associate-/r/78.2%
unpow278.2%
associate-*r*79.5%
Applied egg-rr79.5%
Taylor expanded in x around inf 78.5%
sub-neg42.9%
mul-1-neg42.9%
log-rec42.9%
remove-double-neg42.9%
metadata-eval42.9%
Simplified78.5%
if -9.499999999999999e80 < y < 6.99999999999999976e161Initial program 94.6%
Taylor expanded in x around inf 94.3%
sub-neg67.1%
mul-1-neg67.1%
log-rec67.1%
remove-double-neg67.1%
metadata-eval67.1%
Simplified94.3%
Taylor expanded in y around 0 90.4%
Final simplification87.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -3.7e-35) (not (<= z 2e-62)))
(+ (* x (+ (log x) -1.0)) (* z (* z (/ y x))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 1.0 (* x 12.000000000000048)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e-35) || !(z <= 2e-62)) {
tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
}
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 <= (-3.7d-35)) .or. (.not. (z <= 2d-62))) then
tmp = (x * (log(x) + (-1.0d0))) + (z * (z * (y / x)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (1.0d0 / (x * 12.000000000000048d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e-35) || !(z <= 2e-62)) {
tmp = (x * (Math.log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.7e-35) or not (z <= 2e-62): tmp = (x * (math.log(x) + -1.0)) + (z * (z * (y / x))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.7e-35) || !(z <= 2e-62)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(1.0 / Float64(x * 12.000000000000048))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.7e-35) || ~((z <= 2e-62))) tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.7e-35], N[Not[LessEqual[z, 2e-62]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-35} \lor \neg \left(z \leq 2 \cdot 10^{-62}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -3.6999999999999999e-35 or 2.0000000000000001e-62 < z Initial program 90.5%
Taylor expanded in y around inf 69.7%
associate-/l*73.8%
Simplified73.8%
associate-/r/70.3%
unpow270.3%
associate-*r*74.7%
Applied egg-rr74.7%
Taylor expanded in x around inf 74.6%
sub-neg30.1%
mul-1-neg30.1%
log-rec30.1%
remove-double-neg30.1%
metadata-eval30.1%
Simplified74.6%
if -3.6999999999999999e-35 < z < 2.0000000000000001e-62Initial program 99.4%
Taylor expanded in z around 0 97.0%
clear-num45.5%
inv-pow45.5%
div-inv45.6%
metadata-eval45.6%
Applied egg-rr97.1%
unpow-145.6%
Simplified97.1%
Final simplification84.9%
(FPCore (x y z)
:precision binary64
(if (or (<= z -3.3e-34) (not (<= z 1.95e-53)))
(+ (* x (+ (log x) -1.0)) (* z (* z (/ y x))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ (/ 1.0 x) 12.000000000000048))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.3e-34) || !(z <= 1.95e-53)) {
tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((1.0 / x) / 12.000000000000048);
}
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 <= (-3.3d-34)) .or. (.not. (z <= 1.95d-53))) then
tmp = (x * (log(x) + (-1.0d0))) + (z * (z * (y / x)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((1.0d0 / x) / 12.000000000000048d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.3e-34) || !(z <= 1.95e-53)) {
tmp = (x * (Math.log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((1.0 / x) / 12.000000000000048);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.3e-34) or not (z <= 1.95e-53): tmp = (x * (math.log(x) + -1.0)) + (z * (z * (y / x))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((1.0 / x) / 12.000000000000048) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.3e-34) || !(z <= 1.95e-53)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(1.0 / x) / 12.000000000000048)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.3e-34) || ~((z <= 1.95e-53))) tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((1.0 / x) / 12.000000000000048); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.3e-34], N[Not[LessEqual[z, 1.95e-53]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(y / x), $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[(1.0 / x), $MachinePrecision] / 12.000000000000048), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-34} \lor \neg \left(z \leq 1.95 \cdot 10^{-53}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{\frac{1}{x}}{12.000000000000048}\\
\end{array}
\end{array}
if z < -3.29999999999999983e-34 or 1.9500000000000001e-53 < z Initial program 90.5%
Taylor expanded in y around inf 69.7%
associate-/l*73.8%
Simplified73.8%
associate-/r/70.3%
unpow270.3%
associate-*r*74.7%
Applied egg-rr74.7%
Taylor expanded in x around inf 74.6%
sub-neg30.1%
mul-1-neg30.1%
log-rec30.1%
remove-double-neg30.1%
metadata-eval30.1%
Simplified74.6%
if -3.29999999999999983e-34 < z < 1.9500000000000001e-53Initial program 99.4%
div-inv99.4%
*-commutative99.4%
fma-udef99.4%
fma-neg99.4%
metadata-eval99.4%
Applied egg-rr99.4%
un-div-inv99.4%
clear-num99.4%
div-inv99.5%
associate-/r*99.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 97.1%
Final simplification84.9%
(FPCore (x y z)
:precision binary64
(if (<= x 6e+161)
(+
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
(* x (+ (log x) -1.0)))
(+ (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)) (/ y (/ (/ x z) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6e+161) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y / ((x / z) / z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 6d+161) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (y / ((x / z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 6e+161) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (y / ((x / z) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 6e+161: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (math.log(x) + -1.0)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (y / ((x / z) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 6e+161) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(y / Float64(Float64(x / z) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 6e+161) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y / ((x / z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6e+161], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6 \cdot 10^{+161}:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y}{\frac{\frac{x}{z}}{z}}\\
\end{array}
\end{array}
if x < 6.00000000000000023e161Initial program 98.2%
Taylor expanded in x around inf 97.5%
sub-neg52.9%
mul-1-neg52.9%
log-rec52.9%
remove-double-neg52.9%
metadata-eval52.9%
Simplified97.5%
if 6.00000000000000023e161 < x Initial program 82.5%
Taylor expanded in y around inf 80.3%
associate-/l*85.2%
Simplified85.2%
*-un-lft-identity85.2%
unpow285.2%
times-frac96.6%
Applied egg-rr96.6%
associate-*l/96.6%
*-lft-identity96.6%
Simplified96.6%
Final simplification97.3%
(FPCore (x y z)
:precision binary64
(if (<= x 1.3e-14)
(+
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
(* x (+ (log x) -1.0)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ z (/ (/ x (+ y 0.0007936500793651)) z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.3e-14) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z / ((x / (y + 0.0007936500793651)) / 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.3d-14) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (z / ((x / (y + 0.0007936500793651d0)) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.3e-14) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (z / ((x / (y + 0.0007936500793651)) / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.3e-14: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (math.log(x) + -1.0)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (z / ((x / (y + 0.0007936500793651)) / z)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.3e-14) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z / Float64(Float64(x / Float64(y + 0.0007936500793651)) / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.3e-14) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z / ((x / (y + 0.0007936500793651)) / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.3e-14], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z / N[(N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3 \cdot 10^{-14}:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{z}{\frac{\frac{x}{y + 0.0007936500793651}}{z}}\\
\end{array}
\end{array}
if x < 1.29999999999999998e-14Initial program 99.7%
Taylor expanded in x around inf 99.7%
sub-neg47.2%
mul-1-neg47.2%
log-rec47.2%
remove-double-neg47.2%
metadata-eval47.2%
Simplified99.7%
if 1.29999999999999998e-14 < x Initial program 90.0%
Taylor expanded in z around inf 89.6%
associate-/l*91.8%
Simplified91.8%
unpow291.8%
div-inv91.8%
times-frac97.1%
+-commutative97.1%
Applied egg-rr97.1%
frac-times91.8%
associate-/l*99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Final simplification99.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= z -2.6e-33) (not (<= z 3.1e-53)))
(+ t_0 (* z (* z (/ y x))))
(+ 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.6e-33) || !(z <= 3.1e-53)) {
tmp = t_0 + (z * (z * (y / x)));
} 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.6d-33)) .or. (.not. (z <= 3.1d-53))) then
tmp = t_0 + (z * (z * (y / x)))
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.6e-33) || !(z <= 3.1e-53)) {
tmp = t_0 + (z * (z * (y / x)));
} 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.6e-33) or not (z <= 3.1e-53): tmp = t_0 + (z * (z * (y / x))) 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.6e-33) || !(z <= 3.1e-53)) tmp = Float64(t_0 + Float64(z * Float64(z * Float64(y / x)))); 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.6e-33) || ~((z <= 3.1e-53))) tmp = t_0 + (z * (z * (y / x))); 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.6e-33], N[Not[LessEqual[z, 3.1e-53]], $MachinePrecision]], N[(t$95$0 + N[(z * N[(z * N[(y / x), $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.6 \cdot 10^{-33} \lor \neg \left(z \leq 3.1 \cdot 10^{-53}\right):\\
\;\;\;\;t_0 + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.59999999999999994e-33 or 3.10000000000000015e-53 < z Initial program 90.5%
Taylor expanded in y around inf 69.7%
associate-/l*73.8%
Simplified73.8%
associate-/r/70.3%
unpow270.3%
associate-*r*74.7%
Applied egg-rr74.7%
Taylor expanded in x around inf 74.6%
sub-neg30.1%
mul-1-neg30.1%
log-rec30.1%
remove-double-neg30.1%
metadata-eval30.1%
Simplified74.6%
if -2.59999999999999994e-33 < z < 3.10000000000000015e-53Initial program 99.4%
Taylor expanded in z around 0 97.0%
Taylor expanded in x around inf 95.8%
sub-neg95.8%
mul-1-neg95.8%
log-rec95.8%
remove-double-neg95.8%
metadata-eval95.8%
Simplified95.8%
Final simplification84.3%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.2e-34) (not (<= z 1.6e-60)))
(+ (* x (+ (log x) -1.0)) (* z (* z (/ y x))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.2e-34) || !(z <= 1.6e-60)) {
tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.2d-34)) .or. (.not. (z <= 1.6d-60))) then
tmp = (x * (log(x) + (-1.0d0))) + (z * (z * (y / x)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.2e-34) || !(z <= 1.6e-60)) {
tmp = (x * (Math.log(x) + -1.0)) + (z * (z * (y / x)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.2e-34) or not (z <= 1.6e-60): tmp = (x * (math.log(x) + -1.0)) + (z * (z * (y / x))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.2e-34) || !(z <= 1.6e-60)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(z * Float64(z * Float64(y / x)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.2e-34) || ~((z <= 1.6e-60))) tmp = (x * (log(x) + -1.0)) + (z * (z * (y / x))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.2e-34], N[Not[LessEqual[z, 1.6e-60]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-34} \lor \neg \left(z \leq 1.6 \cdot 10^{-60}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(z \cdot \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.19999999999999996e-34 or 1.6000000000000001e-60 < z Initial program 90.5%
Taylor expanded in y around inf 69.7%
associate-/l*73.8%
Simplified73.8%
associate-/r/70.3%
unpow270.3%
associate-*r*74.7%
Applied egg-rr74.7%
Taylor expanded in x around inf 74.6%
sub-neg30.1%
mul-1-neg30.1%
log-rec30.1%
remove-double-neg30.1%
metadata-eval30.1%
Simplified74.6%
if -1.19999999999999996e-34 < z < 1.6000000000000001e-60Initial program 99.4%
Taylor expanded in z around 0 97.0%
Final simplification84.9%
(FPCore (x y z) :precision binary64 (if (<= x 1.05) (- (/ 1.0 (* x 12.000000000000048)) x) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.05) {
tmp = (1.0 / (x * 12.000000000000048)) - x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.05d0) then
tmp = (1.0d0 / (x * 12.000000000000048d0)) - x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.05) {
tmp = (1.0 / (x * 12.000000000000048)) - x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.05: tmp = (1.0 / (x * 12.000000000000048)) - x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.05) tmp = Float64(Float64(1.0 / Float64(x * 12.000000000000048)) - x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.05) tmp = (1.0 / (x * 12.000000000000048)) - x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.05], N[(N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.05:\\
\;\;\;\;\frac{1}{x \cdot 12.000000000000048} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.05000000000000004Initial program 99.7%
Taylor expanded in z around 0 45.8%
add-sqr-sqrt45.8%
pow245.8%
sub-neg45.8%
metadata-eval45.8%
Applied egg-rr45.8%
Taylor expanded in x around inf 45.8%
neg-mul-145.8%
Simplified45.8%
clear-num45.7%
inv-pow45.7%
div-inv45.8%
metadata-eval45.8%
Applied egg-rr45.8%
unpow-145.8%
Simplified45.8%
if 1.05000000000000004 < x Initial program 89.7%
sub-neg89.7%
associate-+l+89.7%
fma-def89.7%
sub-neg89.7%
metadata-eval89.7%
+-commutative89.7%
unsub-neg89.7%
*-commutative89.7%
fma-def89.7%
fma-neg89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in y around inf 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in x around inf 73.6%
sub-neg73.6%
mul-1-neg73.6%
log-rec73.6%
remove-double-neg73.6%
metadata-eval73.6%
Simplified73.6%
Final simplification60.1%
(FPCore (x y z) :precision binary64 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
def code(x, y, z): return (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
function code(x, y, z) return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}
\end{array}
Initial program 94.6%
Taylor expanded in z around 0 60.7%
Taylor expanded in x around inf 60.1%
sub-neg60.1%
mul-1-neg60.1%
log-rec60.1%
remove-double-neg60.1%
metadata-eval60.1%
Simplified60.1%
Final simplification60.1%
(FPCore (x y z) :precision binary64 (- (/ 1.0 (* x 12.000000000000048)) x))
double code(double x, double y, double z) {
return (1.0 / (x * 12.000000000000048)) - x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (1.0d0 / (x * 12.000000000000048d0)) - x
end function
public static double code(double x, double y, double z) {
return (1.0 / (x * 12.000000000000048)) - x;
}
def code(x, y, z): return (1.0 / (x * 12.000000000000048)) - x
function code(x, y, z) return Float64(Float64(1.0 / Float64(x * 12.000000000000048)) - x) end
function tmp = code(x, y, z) tmp = (1.0 / (x * 12.000000000000048)) - x; end
code[x_, y_, z_] := N[(N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot 12.000000000000048} - x
\end{array}
Initial program 94.6%
Taylor expanded in z around 0 60.7%
add-sqr-sqrt60.5%
pow260.5%
sub-neg60.5%
metadata-eval60.5%
Applied egg-rr60.5%
Taylor expanded in x around inf 22.7%
neg-mul-122.7%
Simplified22.7%
clear-num22.6%
inv-pow22.6%
div-inv22.7%
metadata-eval22.7%
Applied egg-rr22.7%
unpow-122.7%
Simplified22.7%
Final simplification22.7%
(FPCore (x y z) :precision binary64 (- (/ 0.083333333333333 x) x))
double code(double x, double y, double z) {
return (0.083333333333333 / x) - x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 / x) - x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) - x;
}
def code(x, y, z): return (0.083333333333333 / x) - x
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) - x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) - x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} - x
\end{array}
Initial program 94.6%
Taylor expanded in z around 0 60.7%
add-sqr-sqrt60.5%
pow260.5%
sub-neg60.5%
metadata-eval60.5%
Applied egg-rr60.5%
Taylor expanded in x around inf 22.7%
neg-mul-122.7%
Simplified22.7%
Final simplification22.7%
(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 2024021
(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)))