
(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
(let* ((t_0 (* (log x) (- x 0.5))))
(if (<= x 2e+146)
(+
(+ 0.91893853320467 (- t_0 x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(+ t_0 (* z (* z (/ (- y -0.0007936500793651) x))))))
x))))
double code(double x, double y, double z) {
double t_0 = log(x) * (x - 0.5);
double tmp;
if (x <= 2e+146) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * ((y - -0.0007936500793651) / x)))))) - 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 = log(x) * (x - 0.5d0)
if (x <= 2d+146) then
tmp = (0.91893853320467d0 + (t_0 - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + (t_0 + (z * (z * ((y - (-0.0007936500793651d0)) / x)))))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.log(x) * (x - 0.5);
double tmp;
if (x <= 2e+146) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * ((y - -0.0007936500793651) / x)))))) - x;
}
return tmp;
}
def code(x, y, z): t_0 = math.log(x) * (x - 0.5) tmp = 0 if x <= 2e+146: tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * ((y - -0.0007936500793651) / x)))))) - x return tmp
function code(x, y, z) t_0 = Float64(log(x) * Float64(x - 0.5)) tmp = 0.0 if (x <= 2e+146) tmp = Float64(Float64(0.91893853320467 + Float64(t_0 - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(t_0 + Float64(z * Float64(z * Float64(Float64(y - -0.0007936500793651) / x)))))) - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = log(x) * (x - 0.5); tmp = 0.0; if (x <= 2e+146) tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * ((y - -0.0007936500793651) / x)))))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2e+146], N[(N[(0.91893853320467 + N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(z * N[(z * N[(N[(y - -0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x - 0.5\right)\\
\mathbf{if}\;x \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\left(0.91893853320467 + \left(t\_0 - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(t\_0 + z \cdot \left(z \cdot \frac{y - -0.0007936500793651}{x}\right)\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 1.99999999999999987e146Initial program 99.6%
if 1.99999999999999987e146 < x Initial program 82.1%
associate-+l+82.1%
fmm-def82.2%
sub-neg82.2%
metadata-eval82.2%
fma-define82.2%
fmm-def82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around 0 99.5%
Taylor expanded in x around -inf 82.1%
mul-1-neg82.1%
associate-/l*99.5%
distribute-lft-neg-in99.5%
sub-neg99.5%
mul-1-neg99.5%
distribute-neg-in99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in z around inf 99.5%
mul-1-neg99.5%
distribute-frac-neg99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
distribute-lft-in99.5%
metadata-eval99.5%
neg-mul-199.5%
sub-neg99.5%
associate-*r/99.5%
Simplified99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (log x) (- x 0.5))))
(if (<= x 1.3e+148)
(+
(+ 0.91893853320467 (- t_0 x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(-
(+
0.91893853320467
(+ (* 0.083333333333333 (/ 1.0 x)) (+ t_0 (* z (/ (* z y) x)))))
x))))
double code(double x, double y, double z) {
double t_0 = log(x) * (x - 0.5);
double tmp;
if (x <= 1.3e+148) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * ((z * y) / x))))) - 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 = log(x) * (x - 0.5d0)
if (x <= 1.3d+148) then
tmp = (0.91893853320467d0 + (t_0 - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + (t_0 + (z * ((z * y) / x))))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.log(x) * (x - 0.5);
double tmp;
if (x <= 1.3e+148) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * ((z * y) / x))))) - x;
}
return tmp;
}
def code(x, y, z): t_0 = math.log(x) * (x - 0.5) tmp = 0 if x <= 1.3e+148: tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * ((z * y) / x))))) - x return tmp
function code(x, y, z) t_0 = Float64(log(x) * Float64(x - 0.5)) tmp = 0.0 if (x <= 1.3e+148) tmp = Float64(Float64(0.91893853320467 + Float64(t_0 - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(t_0 + Float64(z * Float64(Float64(z * y) / x))))) - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = log(x) * (x - 0.5); tmp = 0.0; if (x <= 1.3e+148) tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * ((z * y) / x))))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.3e+148], N[(N[(0.91893853320467 + N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(z * N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x - 0.5\right)\\
\mathbf{if}\;x \leq 1.3 \cdot 10^{+148}:\\
\;\;\;\;\left(0.91893853320467 + \left(t\_0 - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(t\_0 + z \cdot \frac{z \cdot y}{x}\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 1.3e148Initial program 99.6%
if 1.3e148 < x Initial program 82.1%
associate-+l+82.1%
fmm-def82.2%
sub-neg82.2%
metadata-eval82.2%
fma-define82.2%
fmm-def82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around 0 99.5%
Taylor expanded in x around -inf 82.1%
mul-1-neg82.1%
associate-/l*99.5%
distribute-lft-neg-in99.5%
sub-neg99.5%
mul-1-neg99.5%
distribute-neg-in99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in y around inf 98.0%
associate-*r/98.0%
associate-*r*98.0%
neg-mul-198.0%
*-commutative98.0%
Simplified98.0%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(if (<= x 3.6e+166)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.6e+166) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = x * (log(x) + -1.0);
}
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 <= 3.6d+166) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.6e+166) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.6e+166: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.6e+166) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.6e+166) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.6e+166], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.6 \cdot 10^{+166}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 3.5999999999999997e166Initial program 99.2%
if 3.5999999999999997e166 < x Initial program 81.9%
associate-+l+81.9%
fmm-def82.0%
sub-neg82.0%
metadata-eval82.0%
fma-define82.0%
fmm-def82.0%
metadata-eval82.0%
Simplified82.0%
Taylor expanded in x around inf 92.4%
sub-neg92.4%
mul-1-neg92.4%
log-rec92.4%
remove-double-neg92.4%
metadata-eval92.4%
Simplified92.4%
Final simplification97.7%
(FPCore (x y z)
:precision binary64
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(-
(* (log x) (- x 0.5))
(* z (/ (+ 0.0027777777777778 (* z (- -0.0007936500793651 y))) x)))))
x))
double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((log(x) * (x - 0.5)) - (z * ((0.0027777777777778 + (z * (-0.0007936500793651 - y))) / 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.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + ((log(x) * (x - 0.5d0)) - (z * ((0.0027777777777778d0 + (z * ((-0.0007936500793651d0) - y))) / x))))) - x
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((Math.log(x) * (x - 0.5)) - (z * ((0.0027777777777778 + (z * (-0.0007936500793651 - y))) / x))))) - x;
}
def code(x, y, z): return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((math.log(x) * (x - 0.5)) - (z * ((0.0027777777777778 + (z * (-0.0007936500793651 - y))) / x))))) - x
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(log(x) * Float64(x - 0.5)) - Float64(z * Float64(Float64(0.0027777777777778 + Float64(z * Float64(-0.0007936500793651 - y))) / x))))) - x) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((log(x) * (x - 0.5)) - (z * ((0.0027777777777778 + (z * (-0.0007936500793651 - y))) / x))))) - x; end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - N[(z * N[(N[(0.0027777777777778 + N[(z * N[(-0.0007936500793651 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(\log x \cdot \left(x - 0.5\right) - z \cdot \frac{0.0027777777777778 + z \cdot \left(-0.0007936500793651 - y\right)}{x}\right)\right)\right) - x
\end{array}
Initial program 95.6%
associate-+l+95.6%
fmm-def95.6%
sub-neg95.6%
metadata-eval95.6%
fma-define95.6%
fmm-def95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in z around 0 95.1%
Taylor expanded in x around -inf 95.5%
mul-1-neg95.5%
associate-/l*98.1%
distribute-lft-neg-in98.1%
sub-neg98.1%
mul-1-neg98.1%
distribute-neg-in98.1%
+-commutative98.1%
distribute-neg-in98.1%
metadata-eval98.1%
unsub-neg98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 1e+166)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
t_0)
t_0)))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 1e+166) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (x <= 1d+166) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + t_0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (x <= 1e+166) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 1e+166: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 1e+166) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 1e+166) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + t_0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1e+166], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 10^{+166}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 9.9999999999999994e165Initial program 99.1%
add-cube-cbrt98.7%
pow398.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
Applied egg-rr98.8%
Taylor expanded in x around inf 97.4%
sub-neg97.4%
mul-1-neg97.4%
log-rec97.4%
remove-double-neg97.4%
metadata-eval97.4%
Simplified97.4%
if 9.9999999999999994e165 < x Initial program 82.5%
associate-+l+82.5%
fmm-def82.6%
sub-neg82.6%
metadata-eval82.6%
fma-define82.6%
fmm-def82.6%
metadata-eval82.6%
Simplified82.6%
Taylor expanded in x around inf 92.6%
sub-neg92.6%
mul-1-neg92.6%
log-rec92.6%
remove-double-neg92.6%
metadata-eval92.6%
Simplified92.6%
Final simplification96.4%
(FPCore (x y z)
:precision binary64
(if (<= x 1.15e+45)
(/
(+
0.083333333333333
(* (pow z 2.0) (+ 0.0007936500793651 (- y (/ 0.0027777777777778 z)))))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.15e+45) {
tmp = (0.083333333333333 + (pow(z, 2.0) * (0.0007936500793651 + (y - (0.0027777777777778 / z))))) / 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.15d+45) then
tmp = (0.083333333333333d0 + ((z ** 2.0d0) * (0.0007936500793651d0 + (y - (0.0027777777777778d0 / z))))) / 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.15e+45) {
tmp = (0.083333333333333 + (Math.pow(z, 2.0) * (0.0007936500793651 + (y - (0.0027777777777778 / z))))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.15e+45: tmp = (0.083333333333333 + (math.pow(z, 2.0) * (0.0007936500793651 + (y - (0.0027777777777778 / z))))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.15e+45) tmp = Float64(Float64(0.083333333333333 + Float64((z ^ 2.0) * Float64(0.0007936500793651 + Float64(y - Float64(0.0027777777777778 / z))))) / 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.15e+45) tmp = (0.083333333333333 + ((z ^ 2.0) * (0.0007936500793651 + (y - (0.0027777777777778 / z))))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.15e+45], N[(N[(0.083333333333333 + N[(N[Power[z, 2.0], $MachinePrecision] * N[(0.0007936500793651 + N[(y - N[(0.0027777777777778 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.15 \cdot 10^{+45}:\\
\;\;\;\;\frac{0.083333333333333 + {z}^{2} \cdot \left(0.0007936500793651 + \left(y - \frac{0.0027777777777778}{z}\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 1.15000000000000006e45Initial program 99.6%
associate-+l+99.6%
fmm-def99.6%
sub-neg99.6%
metadata-eval99.6%
fma-define99.6%
fmm-def99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 92.8%
Taylor expanded in z around inf 92.8%
associate--l+92.8%
associate-*r/92.8%
metadata-eval92.8%
Simplified92.8%
if 1.15000000000000006e45 < x Initial program 90.5%
associate-+l+90.5%
fmm-def90.5%
sub-neg90.5%
metadata-eval90.5%
fma-define90.5%
fmm-def90.5%
metadata-eval90.5%
Simplified90.5%
Taylor expanded in x around inf 82.4%
sub-neg82.4%
mul-1-neg82.4%
log-rec82.4%
remove-double-neg82.4%
metadata-eval82.4%
Simplified82.4%
(FPCore (x y z)
:precision binary64
(if (<= x 7e+42)
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 7e+42) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / 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 <= 7d+42) then
tmp = (0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / 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 <= 7e+42) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 7e+42: tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 7e+42) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / 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 <= 7e+42) tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 7e+42], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $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 7 \cdot 10^{+42}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 7.00000000000000047e42Initial program 99.6%
associate-+l+99.6%
fmm-def99.6%
sub-neg99.6%
metadata-eval99.6%
fma-define99.6%
fmm-def99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 92.8%
if 7.00000000000000047e42 < x Initial program 90.5%
associate-+l+90.5%
fmm-def90.5%
sub-neg90.5%
metadata-eval90.5%
fma-define90.5%
fmm-def90.5%
metadata-eval90.5%
Simplified90.5%
Taylor expanded in x around inf 82.4%
sub-neg82.4%
mul-1-neg82.4%
log-rec82.4%
remove-double-neg82.4%
metadata-eval82.4%
Simplified82.4%
Final simplification88.2%
(FPCore (x y z)
:precision binary64
(if (or (<= y -0.00078) (not (<= y 15.0)))
(/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x)
(/
(+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00078) || !(y <= 15.0)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-0.00078d0)) .or. (.not. (y <= 15.0d0))) then
tmp = (0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x
else
tmp = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00078) || !(y <= 15.0)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.00078) or not (y <= 15.0): tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x else: tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.00078) || !(y <= 15.0)) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x); else tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.00078) || ~((y <= 15.0))) tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x; else tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00078], N[Not[LessEqual[y, 15.0]], $MachinePrecision]], N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00078 \lor \neg \left(y \leq 15\right):\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -7.79999999999999986e-4 or 15 < y Initial program 95.0%
associate-+l+95.1%
fmm-def95.1%
sub-neg95.1%
metadata-eval95.1%
fma-define95.1%
fmm-def95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in x around 0 65.7%
Taylor expanded in y around inf 65.6%
*-commutative65.6%
Simplified65.6%
if -7.79999999999999986e-4 < y < 15Initial program 96.1%
associate-+l+96.1%
fmm-def96.1%
sub-neg96.1%
metadata-eval96.1%
fma-define96.1%
fmm-def96.2%
metadata-eval96.2%
Simplified96.2%
Taylor expanded in x around 0 55.6%
Taylor expanded in y around 0 55.0%
*-commutative55.0%
Simplified55.0%
Final simplification60.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -3.4e-54) (not (<= z 4.1e-29))) (* (* z z) (+ (/ 0.0007936500793651 x) (/ y x))) (/ 1.0 (* x 12.000000000000048))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.4e-54) || !(z <= 4.1e-29)) {
tmp = (z * z) * ((0.0007936500793651 / x) + (y / x));
} else {
tmp = 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.4d-54)) .or. (.not. (z <= 4.1d-29))) then
tmp = (z * z) * ((0.0007936500793651d0 / x) + (y / x))
else
tmp = 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.4e-54) || !(z <= 4.1e-29)) {
tmp = (z * z) * ((0.0007936500793651 / x) + (y / x));
} else {
tmp = 1.0 / (x * 12.000000000000048);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.4e-54) or not (z <= 4.1e-29): tmp = (z * z) * ((0.0007936500793651 / x) + (y / x)) else: tmp = 1.0 / (x * 12.000000000000048) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.4e-54) || !(z <= 4.1e-29)) tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(y / x))); else tmp = Float64(1.0 / Float64(x * 12.000000000000048)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.4e-54) || ~((z <= 4.1e-29))) tmp = (z * z) * ((0.0007936500793651 / x) + (y / x)); else tmp = 1.0 / (x * 12.000000000000048); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.4e-54], N[Not[LessEqual[z, 4.1e-29]], $MachinePrecision]], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-54} \lor \neg \left(z \leq 4.1 \cdot 10^{-29}\right):\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -3.39999999999999987e-54 or 4.0999999999999998e-29 < z Initial program 91.9%
associate-+l+91.9%
fmm-def92.0%
sub-neg92.0%
metadata-eval92.0%
fma-define92.0%
fmm-def92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in z around inf 69.4%
associate-*r/69.4%
metadata-eval69.4%
Simplified69.4%
unpow269.4%
Applied egg-rr69.4%
if -3.39999999999999987e-54 < z < 4.0999999999999998e-29Initial program 99.4%
associate-+l+99.5%
fmm-def99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.5%
fmm-def99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 48.6%
Taylor expanded in z around 0 43.6%
clear-num43.6%
inv-pow43.6%
div-inv43.7%
metadata-eval43.7%
Applied egg-rr43.7%
unpow-143.7%
Simplified43.7%
Final simplification56.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.1e-54) (not (<= z 9.5e-30))) (* y (/ (* z z) x)) (/ 1.0 (* x 12.000000000000048))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.1e-54) || !(z <= 9.5e-30)) {
tmp = y * ((z * z) / x);
} else {
tmp = 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 <= (-2.1d-54)) .or. (.not. (z <= 9.5d-30))) then
tmp = y * ((z * z) / x)
else
tmp = 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 <= -2.1e-54) || !(z <= 9.5e-30)) {
tmp = y * ((z * z) / x);
} else {
tmp = 1.0 / (x * 12.000000000000048);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.1e-54) or not (z <= 9.5e-30): tmp = y * ((z * z) / x) else: tmp = 1.0 / (x * 12.000000000000048) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.1e-54) || !(z <= 9.5e-30)) tmp = Float64(y * Float64(Float64(z * z) / x)); else tmp = Float64(1.0 / Float64(x * 12.000000000000048)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.1e-54) || ~((z <= 9.5e-30))) tmp = y * ((z * z) / x); else tmp = 1.0 / (x * 12.000000000000048); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.1e-54], N[Not[LessEqual[z, 9.5e-30]], $MachinePrecision]], N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-54} \lor \neg \left(z \leq 9.5 \cdot 10^{-30}\right):\\
\;\;\;\;y \cdot \frac{z \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -2.1e-54 or 9.49999999999999939e-30 < z Initial program 91.9%
associate-+l+91.9%
fmm-def92.0%
sub-neg92.0%
metadata-eval92.0%
fma-define92.0%
fmm-def92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in y around inf 47.9%
associate-/l*50.0%
Simplified50.0%
unpow269.4%
Applied egg-rr50.0%
if -2.1e-54 < z < 9.49999999999999939e-30Initial program 99.4%
associate-+l+99.5%
fmm-def99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.5%
fmm-def99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 48.6%
Taylor expanded in z around 0 43.6%
clear-num43.6%
inv-pow43.6%
div-inv43.7%
metadata-eval43.7%
Applied egg-rr43.7%
unpow-143.7%
Simplified43.7%
Final simplification46.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -3e-54) (not (<= z 3.7e-29))) (* y (* z (/ z x))) (/ 1.0 (* x 12.000000000000048))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3e-54) || !(z <= 3.7e-29)) {
tmp = y * (z * (z / x));
} else {
tmp = 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 <= (-3d-54)) .or. (.not. (z <= 3.7d-29))) then
tmp = y * (z * (z / x))
else
tmp = 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 <= -3e-54) || !(z <= 3.7e-29)) {
tmp = y * (z * (z / x));
} else {
tmp = 1.0 / (x * 12.000000000000048);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3e-54) or not (z <= 3.7e-29): tmp = y * (z * (z / x)) else: tmp = 1.0 / (x * 12.000000000000048) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3e-54) || !(z <= 3.7e-29)) tmp = Float64(y * Float64(z * Float64(z / x))); else tmp = Float64(1.0 / Float64(x * 12.000000000000048)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3e-54) || ~((z <= 3.7e-29))) tmp = y * (z * (z / x)); else tmp = 1.0 / (x * 12.000000000000048); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3e-54], N[Not[LessEqual[z, 3.7e-29]], $MachinePrecision]], N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-54} \lor \neg \left(z \leq 3.7 \cdot 10^{-29}\right):\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -3.00000000000000009e-54 or 3.6999999999999997e-29 < z Initial program 91.9%
associate-+l+91.9%
fmm-def92.0%
sub-neg92.0%
metadata-eval92.0%
fma-define92.0%
fmm-def92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in y around inf 47.9%
associate-/l*50.0%
Simplified50.0%
unpow250.0%
associate-/l*49.8%
Applied egg-rr49.8%
if -3.00000000000000009e-54 < z < 3.6999999999999997e-29Initial program 99.4%
associate-+l+99.5%
fmm-def99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.5%
fmm-def99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 48.6%
Taylor expanded in z around 0 43.6%
clear-num43.6%
inv-pow43.6%
div-inv43.7%
metadata-eval43.7%
Applied egg-rr43.7%
unpow-143.7%
Simplified43.7%
Final simplification46.9%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 95.6%
associate-+l+95.6%
fmm-def95.6%
sub-neg95.6%
metadata-eval95.6%
fma-define95.6%
fmm-def95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in x around 0 60.4%
Final simplification60.4%
(FPCore (x y z) :precision binary64 (/ 1.0 (* x 12.000000000000048)))
double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
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)
end function
public static double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
def code(x, y, z): return 1.0 / (x * 12.000000000000048)
function code(x, y, z) return Float64(1.0 / Float64(x * 12.000000000000048)) end
function tmp = code(x, y, z) tmp = 1.0 / (x * 12.000000000000048); end
code[x_, y_, z_] := N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot 12.000000000000048}
\end{array}
Initial program 95.6%
associate-+l+95.6%
fmm-def95.6%
sub-neg95.6%
metadata-eval95.6%
fma-define95.6%
fmm-def95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in x around 0 60.4%
Taylor expanded in z around 0 23.5%
clear-num23.5%
inv-pow23.5%
div-inv23.6%
metadata-eval23.6%
Applied egg-rr23.6%
unpow-123.6%
Simplified23.6%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 95.6%
associate-+l+95.6%
fmm-def95.6%
sub-neg95.6%
metadata-eval95.6%
fma-define95.6%
fmm-def95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in x around 0 60.4%
Taylor expanded in z around 0 23.5%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024152
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))