
(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 16 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
(-
(+
0.91893853320467
(+
(/ 0.083333333333333 x)
(+ (* z (* (/ z x) (+ 0.0007936500793651 y))) (* (log x) (- x 0.5)))))
x))
double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 / x) + ((z * ((z / x) * (0.0007936500793651 + y))) + (log(x) * (x - 0.5))))) - 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 / x) + ((z * ((z / x) * (0.0007936500793651d0 + y))) + (log(x) * (x - 0.5d0))))) - x
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 / x) + ((z * ((z / x) * (0.0007936500793651 + y))) + (Math.log(x) * (x - 0.5))))) - x;
}
def code(x, y, z): return (0.91893853320467 + ((0.083333333333333 / x) + ((z * ((z / x) * (0.0007936500793651 + y))) + (math.log(x) * (x - 0.5))))) - x
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 / x) + Float64(Float64(z * Float64(Float64(z / x) * Float64(0.0007936500793651 + y))) + Float64(log(x) * Float64(x - 0.5))))) - x) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((0.083333333333333 / x) + ((z * ((z / x) * (0.0007936500793651 + y))) + (log(x) * (x - 0.5))))) - x; end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(z * N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(\frac{0.083333333333333}{x} + \left(z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) + \log x \cdot \left(x - 0.5\right)\right)\right)\right) - x
\end{array}
Initial program 95.0%
associate-+l+95.0%
fma-neg95.0%
sub-neg95.0%
metadata-eval95.0%
fma-define95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in z around 0 96.2%
Simplified96.2%
Taylor expanded in z around 0 96.2%
Taylor expanded in z around inf 92.4%
unpow292.4%
associate-*r/92.4%
metadata-eval92.4%
associate-*l*96.0%
distribute-rgt-in91.7%
associate-*l/91.7%
associate-*r/91.3%
associate-*l/94.0%
associate-/l*91.6%
distribute-rgt-out99.1%
Simplified99.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (log x) (- x 0.5))))
(if (<= x 2.1e+113)
(+
(+ 0.91893853320467 (- t_0 x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(-
(+
0.91893853320467
(+ (/ 0.083333333333333 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 <= 2.1e+113) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 / 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 <= 2.1d+113) then
tmp = (0.91893853320467d0 + (t_0 - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 / 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 <= 2.1e+113) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 / 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 <= 2.1e+113: tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((0.083333333333333 / 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 <= 2.1e+113) tmp = Float64(Float64(0.91893853320467 + Float64(t_0 - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 / 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 <= 2.1e+113) tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((0.083333333333333 / 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, 2.1e+113], N[(N[(0.91893853320467 + N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 / x), $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 2.1 \cdot 10^{+113}:\\
\;\;\;\;\left(0.91893853320467 + \left(t\_0 - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\frac{0.083333333333333}{x} + \left(t\_0 + z \cdot \frac{z \cdot y}{x}\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 2.0999999999999999e113Initial program 97.2%
if 2.0999999999999999e113 < x Initial program 89.3%
associate-+l+89.3%
fma-neg89.4%
sub-neg89.4%
metadata-eval89.4%
fma-define89.4%
fma-neg89.4%
metadata-eval89.4%
Simplified89.4%
Taylor expanded in z around 0 99.5%
Simplified99.5%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 90.5%
unpow290.5%
associate-*r/90.5%
metadata-eval90.5%
associate-*l*99.5%
distribute-rgt-in99.5%
associate-*l/99.5%
associate-*r/99.5%
associate-*l/98.3%
associate-/l*99.5%
distribute-rgt-out99.5%
Simplified99.5%
Taylor expanded in y around inf 98.3%
*-commutative98.3%
Simplified98.3%
Final simplification97.5%
(FPCore (x y z)
:precision binary64
(if (<= x 1.4e+116)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0)))
(-
(+
0.91893853320467
(+ (/ 0.083333333333333 x) (+ (* (log x) (- x 0.5)) (* z (/ (* z y) x)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.4e+116) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((0.083333333333333 / x) + ((log(x) * (x - 0.5)) + (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) :: tmp
if (x <= 1.4d+116) then
tmp = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 / x) + ((log(x) * (x - 0.5d0)) + (z * ((z * y) / x))))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.4e+116) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((0.083333333333333 / x) + ((Math.log(x) * (x - 0.5)) + (z * ((z * y) / x))))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.4e+116: tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0)) else: tmp = (0.91893853320467 + ((0.083333333333333 / x) + ((math.log(x) * (x - 0.5)) + (z * ((z * y) / x))))) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.4e+116) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 / x) + Float64(Float64(log(x) * Float64(x - 0.5)) + Float64(z * Float64(Float64(z * y) / x))))) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.4e+116) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); else tmp = (0.91893853320467 + ((0.083333333333333 / x) + ((log(x) * (x - 0.5)) + (z * ((z * y) / x))))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.4e+116], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{+116}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\frac{0.083333333333333}{x} + \left(\log x \cdot \left(x - 0.5\right) + z \cdot \frac{z \cdot y}{x}\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 1.40000000000000002e116Initial program 97.2%
add-sqr-sqrt97.2%
pow297.2%
sub-neg97.2%
metadata-eval97.2%
*-commutative97.2%
Applied egg-rr97.2%
Taylor expanded in x around inf 95.4%
sub-neg95.4%
mul-1-neg95.4%
log-rec95.4%
remove-double-neg95.4%
metadata-eval95.4%
Simplified95.4%
if 1.40000000000000002e116 < x Initial program 89.0%
associate-+l+89.0%
fma-neg89.1%
sub-neg89.1%
metadata-eval89.1%
fma-define89.1%
fma-neg89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in z around 0 99.6%
Simplified99.6%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 90.3%
unpow290.3%
associate-*r/90.3%
metadata-eval90.3%
associate-*l*99.6%
distribute-rgt-in99.6%
associate-*l/99.6%
associate-*r/99.6%
associate-*l/98.2%
associate-/l*99.6%
distribute-rgt-out99.6%
Simplified99.6%
Taylor expanded in y around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 2.8e+156)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 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 <= 2.8e+156) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 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 <= 2.8d+156) then
tmp = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 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 <= 2.8e+156) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 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 <= 2.8e+156: tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 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 <= 2.8e+156) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 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 <= 2.8e+156) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 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, 2.8e+156], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $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 2.8 \cdot 10^{+156}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 2.79999999999999988e156Initial program 97.4%
add-sqr-sqrt97.3%
pow297.3%
sub-neg97.3%
metadata-eval97.3%
*-commutative97.3%
Applied egg-rr97.3%
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%
if 2.79999999999999988e156 < x Initial program 86.3%
associate-+l+86.3%
fma-neg86.5%
sub-neg86.5%
metadata-eval86.5%
fma-define86.5%
fma-neg86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in x around inf 96.4%
sub-neg96.4%
mul-1-neg96.4%
log-rec96.4%
remove-double-neg96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification95.9%
(FPCore (x y z)
:precision binary64
(if (<= x 5.9e+107)
(fma
z
(+ (* (/ z x) (+ 0.0007936500793651 y)) (/ -0.0027777777777778 x))
(/ 0.083333333333333 x))
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.9e+107) {
tmp = fma(z, (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x)), (0.083333333333333 / x));
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5.9e+107) tmp = fma(z, Float64(Float64(Float64(z / x) * Float64(0.0007936500793651 + y)) + Float64(-0.0027777777777778 / x)), Float64(0.083333333333333 / x)); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5.9e+107], N[(z * N[(N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.9 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 5.9000000000000004e107Initial program 97.2%
associate-+l+97.2%
fma-neg97.2%
sub-neg97.2%
metadata-eval97.2%
fma-define97.2%
fma-neg97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in x around 0 87.2%
Taylor expanded in z around 0 84.9%
fma-define84.9%
sub-neg84.9%
distribute-rgt-in78.9%
associate-*r/78.9%
metadata-eval78.9%
associate-*l/78.9%
associate-*r/78.4%
associate-*l/82.6%
associate-/l*78.8%
distribute-rgt-out89.2%
associate-*r/89.2%
metadata-eval89.2%
distribute-neg-frac89.2%
metadata-eval89.2%
associate-*r/89.2%
metadata-eval89.2%
Simplified89.2%
if 5.9000000000000004e107 < x Initial program 89.6%
associate-+l+89.6%
fma-neg89.7%
sub-neg89.7%
metadata-eval89.7%
fma-define89.7%
fma-neg89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in x around inf 88.1%
sub-neg88.1%
mul-1-neg88.1%
log-rec88.1%
remove-double-neg88.1%
metadata-eval88.1%
Simplified88.1%
(FPCore (x y z)
:precision binary64
(if (<= x 5.9e+107)
(+
(* z (* (/ z x) (+ 0.0007936500793651 y)))
(* 0.083333333333333 (/ 1.0 x)))
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.9e+107) {
tmp = (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / 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 <= 5.9d+107) then
tmp = (z * ((z / x) * (0.0007936500793651d0 + y))) + (0.083333333333333d0 * (1.0d0 / 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 <= 5.9e+107) {
tmp = (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / x));
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.9e+107: tmp = (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / x)) else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.9e+107) tmp = Float64(Float64(z * Float64(Float64(z / x) * Float64(0.0007936500793651 + y))) + Float64(0.083333333333333 * Float64(1.0 / 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 <= 5.9e+107) tmp = (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / x)); else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.9e+107], N[(N[(z * N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.9 \cdot 10^{+107}:\\
\;\;\;\;z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) + 0.083333333333333 \cdot \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 5.9000000000000004e107Initial program 97.2%
associate-+l+97.2%
fma-neg97.2%
sub-neg97.2%
metadata-eval97.2%
fma-define97.2%
fma-neg97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in x around 0 87.2%
Taylor expanded in z around 0 84.9%
Taylor expanded in z around inf 83.1%
unpow293.0%
associate-*r/93.0%
metadata-eval93.0%
associate-*l*94.6%
distribute-rgt-in88.5%
associate-*l/88.5%
associate-*r/88.0%
associate-*l/92.3%
associate-/l*88.4%
distribute-rgt-out98.9%
Simplified88.9%
if 5.9000000000000004e107 < x Initial program 89.6%
associate-+l+89.6%
fma-neg89.7%
sub-neg89.7%
metadata-eval89.7%
fma-define89.7%
fma-neg89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in x around inf 88.1%
sub-neg88.1%
mul-1-neg88.1%
log-rec88.1%
remove-double-neg88.1%
metadata-eval88.1%
Simplified88.1%
(FPCore (x y z)
:precision binary64
(if (or (<= y -2.4e+16) (not (<= y 3.6e-33)))
(/ (+ 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 <= -2.4e+16) || !(y <= 3.6e-33)) {
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 <= (-2.4d+16)) .or. (.not. (y <= 3.6d-33))) 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 <= -2.4e+16) || !(y <= 3.6e-33)) {
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 <= -2.4e+16) or not (y <= 3.6e-33): 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 <= -2.4e+16) || !(y <= 3.6e-33)) 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 <= -2.4e+16) || ~((y <= 3.6e-33))) 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, -2.4e+16], N[Not[LessEqual[y, 3.6e-33]], $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 -2.4 \cdot 10^{+16} \lor \neg \left(y \leq 3.6 \cdot 10^{-33}\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 < -2.4e16 or 3.60000000000000034e-33 < y Initial program 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.8%
fma-neg96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in x around 0 69.1%
Taylor expanded in y around inf 69.1%
*-commutative69.1%
Simplified69.1%
if -2.4e16 < y < 3.60000000000000034e-33Initial program 93.4%
associate-+l+93.5%
fma-neg93.5%
sub-neg93.5%
metadata-eval93.5%
fma-define93.5%
fma-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in x around 0 63.1%
Taylor expanded in y around 0 63.1%
*-commutative63.1%
Simplified63.1%
Final simplification66.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.95e+39) (not (<= z 1.25e+25))) (* y (/ 0.083333333333333 (* x y))) (/ (+ 0.083333333333333 (* 0.91893853320467 x)) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.95e+39) || !(z <= 1.25e+25)) {
tmp = y * (0.083333333333333 / (x * y));
} else {
tmp = (0.083333333333333 + (0.91893853320467 * 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) :: tmp
if ((z <= (-1.95d+39)) .or. (.not. (z <= 1.25d+25))) then
tmp = y * (0.083333333333333d0 / (x * y))
else
tmp = (0.083333333333333d0 + (0.91893853320467d0 * x)) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.95e+39) || !(z <= 1.25e+25)) {
tmp = y * (0.083333333333333 / (x * y));
} else {
tmp = (0.083333333333333 + (0.91893853320467 * x)) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.95e+39) or not (z <= 1.25e+25): tmp = y * (0.083333333333333 / (x * y)) else: tmp = (0.083333333333333 + (0.91893853320467 * x)) / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.95e+39) || !(z <= 1.25e+25)) tmp = Float64(y * Float64(0.083333333333333 / Float64(x * y))); else tmp = Float64(Float64(0.083333333333333 + Float64(0.91893853320467 * x)) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.95e+39) || ~((z <= 1.25e+25))) tmp = y * (0.083333333333333 / (x * y)); else tmp = (0.083333333333333 + (0.91893853320467 * x)) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.95e+39], N[Not[LessEqual[z, 1.25e+25]], $MachinePrecision]], N[(y * N[(0.083333333333333 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 + N[(0.91893853320467 * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+39} \lor \neg \left(z \leq 1.25 \cdot 10^{+25}\right):\\
\;\;\;\;y \cdot \frac{0.083333333333333}{x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + 0.91893853320467 \cdot x}{x}\\
\end{array}
\end{array}
if z < -1.95e39 or 1.25000000000000006e25 < z Initial program 88.5%
associate-+l+88.5%
fma-neg88.5%
sub-neg88.5%
metadata-eval88.5%
fma-define88.5%
fma-neg88.5%
metadata-eval88.5%
Simplified88.5%
Taylor expanded in x around 0 82.1%
Taylor expanded in y around inf 49.4%
Taylor expanded in z around 0 16.9%
*-commutative16.9%
Simplified16.9%
if -1.95e39 < z < 1.25000000000000006e25Initial program 99.5%
associate-+l+99.5%
fma-neg99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 93.7%
Simplified93.7%
Taylor expanded in y around inf 79.6%
Taylor expanded in x around inf 88.2%
mul-1-neg88.2%
distribute-rgt-neg-in88.2%
log-rec88.2%
remove-double-neg88.2%
Simplified88.2%
Taylor expanded in x around 0 46.6%
*-commutative46.6%
Simplified46.6%
Final simplification34.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -4e+39) (not (<= z 5.8e+16))) (* y (/ 0.083333333333333 (* x y))) (* 0.083333333333333 (/ 1.0 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+39) || !(z <= 5.8e+16)) {
tmp = y * (0.083333333333333 / (x * y));
} else {
tmp = 0.083333333333333 * (1.0 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-4d+39)) .or. (.not. (z <= 5.8d+16))) then
tmp = y * (0.083333333333333d0 / (x * y))
else
tmp = 0.083333333333333d0 * (1.0d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+39) || !(z <= 5.8e+16)) {
tmp = y * (0.083333333333333 / (x * y));
} else {
tmp = 0.083333333333333 * (1.0 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4e+39) or not (z <= 5.8e+16): tmp = y * (0.083333333333333 / (x * y)) else: tmp = 0.083333333333333 * (1.0 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4e+39) || !(z <= 5.8e+16)) tmp = Float64(y * Float64(0.083333333333333 / Float64(x * y))); else tmp = Float64(0.083333333333333 * Float64(1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4e+39) || ~((z <= 5.8e+16))) tmp = y * (0.083333333333333 / (x * y)); else tmp = 0.083333333333333 * (1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4e+39], N[Not[LessEqual[z, 5.8e+16]], $MachinePrecision]], N[(y * N[(0.083333333333333 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+39} \lor \neg \left(z \leq 5.8 \cdot 10^{+16}\right):\\
\;\;\;\;y \cdot \frac{0.083333333333333}{x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\
\end{array}
\end{array}
if z < -3.99999999999999976e39 or 5.8e16 < z Initial program 88.7%
associate-+l+88.7%
fma-neg88.7%
sub-neg88.7%
metadata-eval88.7%
fma-define88.7%
fma-neg88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in x around 0 82.5%
Taylor expanded in y around inf 50.3%
Taylor expanded in z around 0 16.7%
*-commutative16.7%
Simplified16.7%
if -3.99999999999999976e39 < z < 5.8e16Initial program 99.5%
associate-+l+99.5%
fma-neg99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.5%
fma-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 54.1%
Taylor expanded in z around 0 46.4%
div-inv46.4%
Applied egg-rr46.4%
Final simplification34.0%
(FPCore (x y z) :precision binary64 (if (<= z 2.7e-5) (+ (* 0.083333333333333 (/ 1.0 x)) (/ (* z -0.0027777777777778) x)) (* y (/ 0.083333333333333 (* x y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= 2.7e-5) {
tmp = (0.083333333333333 * (1.0 / x)) + ((z * -0.0027777777777778) / x);
} else {
tmp = y * (0.083333333333333 / (x * y));
}
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.7d-5) then
tmp = (0.083333333333333d0 * (1.0d0 / x)) + ((z * (-0.0027777777777778d0)) / x)
else
tmp = y * (0.083333333333333d0 / (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 2.7e-5) {
tmp = (0.083333333333333 * (1.0 / x)) + ((z * -0.0027777777777778) / x);
} else {
tmp = y * (0.083333333333333 / (x * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 2.7e-5: tmp = (0.083333333333333 * (1.0 / x)) + ((z * -0.0027777777777778) / x) else: tmp = y * (0.083333333333333 / (x * y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 2.7e-5) tmp = Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z * -0.0027777777777778) / x)); else tmp = Float64(y * Float64(0.083333333333333 / Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 2.7e-5) tmp = (0.083333333333333 * (1.0 / x)) + ((z * -0.0027777777777778) / x); else tmp = y * (0.083333333333333 / (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 2.7e-5], N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(y * N[(0.083333333333333 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.7 \cdot 10^{-5}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x} + \frac{z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.083333333333333}{x \cdot y}\\
\end{array}
\end{array}
if z < 2.6999999999999999e-5Initial program 97.3%
associate-+l+97.3%
fma-neg97.3%
sub-neg97.3%
metadata-eval97.3%
fma-define97.3%
fma-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 63.4%
Taylor expanded in z around 0 59.6%
Taylor expanded in z around 0 43.3%
*-commutative43.3%
associate-*l/43.3%
Simplified43.3%
if 2.6999999999999999e-5 < z Initial program 86.4%
associate-+l+86.4%
fma-neg86.4%
sub-neg86.4%
metadata-eval86.4%
fma-define86.4%
fma-neg86.4%
metadata-eval86.4%
Simplified86.4%
Taylor expanded in x around 0 75.6%
Taylor expanded in y around inf 54.8%
Taylor expanded in z around 0 14.2%
*-commutative14.2%
Simplified14.2%
Final simplification37.2%
(FPCore (x y z) :precision binary64 (+ (* z (* (/ z x) (+ 0.0007936500793651 y))) (* 0.083333333333333 (/ 1.0 x))))
double code(double x, double y, double z) {
return (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (z * ((z / x) * (0.0007936500793651d0 + y))) + (0.083333333333333d0 * (1.0d0 / x))
end function
public static double code(double x, double y, double z) {
return (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / x));
}
def code(x, y, z): return (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / x))
function code(x, y, z) return Float64(Float64(z * Float64(Float64(z / x) * Float64(0.0007936500793651 + y))) + Float64(0.083333333333333 * Float64(1.0 / x))) end
function tmp = code(x, y, z) tmp = (z * ((z / x) * (0.0007936500793651 + y))) + (0.083333333333333 * (1.0 / x)); end
code[x_, y_, z_] := N[(N[(z * N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) + 0.083333333333333 \cdot \frac{1}{x}
\end{array}
Initial program 95.0%
associate-+l+95.0%
fma-neg95.0%
sub-neg95.0%
metadata-eval95.0%
fma-define95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in x around 0 66.0%
Taylor expanded in z around 0 64.4%
Taylor expanded in z around inf 63.0%
unpow292.4%
associate-*r/92.4%
metadata-eval92.4%
associate-*l*96.0%
distribute-rgt-in91.7%
associate-*l/91.7%
associate-*r/91.3%
associate-*l/94.0%
associate-/l*91.6%
distribute-rgt-out99.1%
Simplified67.3%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 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 * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 95.0%
associate-+l+95.0%
fma-neg95.0%
sub-neg95.0%
metadata-eval95.0%
fma-define95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in x around 0 66.0%
(FPCore (x y z) :precision binary64 (if (<= z 2.7e-5) (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x) (* y (/ 0.083333333333333 (* x y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= 2.7e-5) {
tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
} else {
tmp = y * (0.083333333333333 / (x * y));
}
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.7d-5) then
tmp = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
else
tmp = y * (0.083333333333333d0 / (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 2.7e-5) {
tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x;
} else {
tmp = y * (0.083333333333333 / (x * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 2.7e-5: tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x else: tmp = y * (0.083333333333333 / (x * y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 2.7e-5) tmp = Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x); else tmp = Float64(y * Float64(0.083333333333333 / Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 2.7e-5) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; else tmp = y * (0.083333333333333 / (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 2.7e-5], N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(y * N[(0.083333333333333 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.083333333333333}{x \cdot y}\\
\end{array}
\end{array}
if z < 2.6999999999999999e-5Initial program 97.3%
associate-+l+97.3%
fma-neg97.3%
sub-neg97.3%
metadata-eval97.3%
fma-define97.3%
fma-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 63.4%
Taylor expanded in z around 0 43.3%
+-commutative43.3%
*-commutative43.3%
Simplified43.3%
if 2.6999999999999999e-5 < z Initial program 86.4%
associate-+l+86.4%
fma-neg86.4%
sub-neg86.4%
metadata-eval86.4%
fma-define86.4%
fma-neg86.4%
metadata-eval86.4%
Simplified86.4%
Taylor expanded in x around 0 75.6%
Taylor expanded in y around inf 54.8%
Taylor expanded in z around 0 14.2%
*-commutative14.2%
Simplified14.2%
Final simplification37.1%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * 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 * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}
\end{array}
Initial program 95.0%
associate-+l+95.0%
fma-neg95.0%
sub-neg95.0%
metadata-eval95.0%
fma-define95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in x around 0 66.0%
Taylor expanded in y around 0 52.1%
*-commutative52.1%
Simplified52.1%
(FPCore (x y z) :precision binary64 (* 0.083333333333333 (/ 1.0 x)))
double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 * (1.0d0 / x)
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / x);
}
def code(x, y, z): return 0.083333333333333 * (1.0 / x)
function code(x, y, z) return Float64(0.083333333333333 * Float64(1.0 / x)) end
function tmp = code(x, y, z) tmp = 0.083333333333333 * (1.0 / x); end
code[x_, y_, z_] := N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x}
\end{array}
Initial program 95.0%
associate-+l+95.0%
fma-neg95.0%
sub-neg95.0%
metadata-eval95.0%
fma-define95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in x around 0 66.0%
Taylor expanded in z around 0 28.5%
div-inv28.5%
Applied egg-rr28.5%
(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.0%
associate-+l+95.0%
fma-neg95.0%
sub-neg95.0%
metadata-eval95.0%
fma-define95.0%
fma-neg95.0%
metadata-eval95.0%
Simplified95.0%
Taylor expanded in x around 0 66.0%
Taylor expanded in z around 0 28.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 2024138
(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)))