
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(+
0.91893853320467
(-
(+
(* 0.083333333333333 (/ 1.0 x))
(+ (* z (/ (+ 0.0007936500793651 y) (/ x z))) (* (log x) (- x 0.5))))
x)))
double code(double x, double y, double z) {
return 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((z * ((0.0007936500793651 + y) / (x / z))) + (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 * (1.0d0 / x)) + ((z * ((0.0007936500793651d0 + y) / (x / z))) + (log(x) * (x - 0.5d0)))) - x)
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((z * ((0.0007936500793651 + y) / (x / z))) + (Math.log(x) * (x - 0.5)))) - x);
}
def code(x, y, z): return 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((z * ((0.0007936500793651 + y) / (x / z))) + (math.log(x) * (x - 0.5)))) - x)
function code(x, y, z) return Float64(0.91893853320467 + Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z * Float64(Float64(0.0007936500793651 + y) / Float64(x / z))) + Float64(log(x) * Float64(x - 0.5)))) - x)) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((z * ((0.0007936500793651 + y) / (x / z))) + (log(x) * (x - 0.5)))) - x); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + \left(\left(0.083333333333333 \cdot \frac{1}{x} + \left(z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}} + \log x \cdot \left(x - 0.5\right)\right)\right) - x\right)
\end{array}
Initial program 92.4%
+-commutative92.4%
associate-+l+92.4%
associate-+l-92.4%
fma-neg92.5%
sub-neg92.5%
metadata-eval92.5%
neg-sub092.5%
associate-+l-92.5%
neg-sub092.5%
+-commutative92.5%
unsub-neg92.5%
Simplified92.5%
Taylor expanded in z around 0 93.2%
Taylor expanded in z around inf 87.6%
unpow287.6%
associate-*l*93.0%
distribute-rgt-in90.7%
associate-*r/90.7%
metadata-eval90.7%
associate-*l/90.7%
associate-*r/90.7%
associate-*l/95.3%
associate-/l*94.0%
distribute-rgt-out99.0%
Simplified99.0%
*-commutative99.0%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -5e+75)
(+ 0.91893853320467 (* (+ (/ y x) (/ 0.0007936500793651 x)) (pow z 2.0)))
(if (<= t_0 2e+104)
(+
0.91893853320467
(- (+ (* 0.083333333333333 (/ 1.0 x)) (* (log x) (- x 0.5))) x))
(+
(/ (+ 0.083333333333333 t_0) x)
(+ 0.91893853320467 (* (log x) -0.5)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+75) {
tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * pow(z, 2.0));
} else if (t_0 <= 2e+104) {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (log(x) * (x - 0.5))) - x);
} else {
tmp = ((0.083333333333333 + t_0) / x) + (0.91893853320467 + (log(x) * -0.5));
}
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 = z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0)
if (t_0 <= (-5d+75)) then
tmp = 0.91893853320467d0 + (((y / x) + (0.0007936500793651d0 / x)) * (z ** 2.0d0))
else if (t_0 <= 2d+104) then
tmp = 0.91893853320467d0 + (((0.083333333333333d0 * (1.0d0 / x)) + (log(x) * (x - 0.5d0))) - x)
else
tmp = ((0.083333333333333d0 + t_0) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e+75) {
tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * Math.pow(z, 2.0));
} else if (t_0 <= 2e+104) {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (Math.log(x) * (x - 0.5))) - x);
} else {
tmp = ((0.083333333333333 + t_0) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778) tmp = 0 if t_0 <= -5e+75: tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * math.pow(z, 2.0)) elif t_0 <= 2e+104: tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (math.log(x) * (x - 0.5))) - x) else: tmp = ((0.083333333333333 + t_0) / x) + (0.91893853320467 + (math.log(x) * -0.5)) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -5e+75) tmp = Float64(0.91893853320467 + Float64(Float64(Float64(y / x) + Float64(0.0007936500793651 / x)) * (z ^ 2.0))); elseif (t_0 <= 2e+104) tmp = Float64(0.91893853320467 + Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(log(x) * Float64(x - 0.5))) - x)); else tmp = Float64(Float64(Float64(0.083333333333333 + t_0) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778); tmp = 0.0; if (t_0 <= -5e+75) tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * (z ^ 2.0)); elseif (t_0 <= 2e+104) tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (log(x) * (x - 0.5))) - x); else tmp = ((0.083333333333333 + t_0) / x) + (0.91893853320467 + (log(x) * -0.5)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+75], N[(0.91893853320467 + N[(N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+104], N[(0.91893853320467 + N[(N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.083333333333333 + t$95$0), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+75}:\\
\;\;\;\;0.91893853320467 + \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot {z}^{2}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+104}:\\
\;\;\;\;0.91893853320467 + \left(\left(0.083333333333333 \cdot \frac{1}{x} + \log x \cdot \left(x - 0.5\right)\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + t\_0}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.0000000000000002e75Initial program 86.8%
+-commutative86.8%
associate-+l+86.8%
associate-+l-86.8%
fma-neg86.9%
sub-neg86.9%
metadata-eval86.9%
neg-sub086.9%
associate-+l-86.9%
neg-sub086.9%
+-commutative86.9%
unsub-neg86.9%
Simplified86.9%
Taylor expanded in z around inf 87.4%
*-commutative87.4%
associate-*r/87.4%
metadata-eval87.4%
Simplified87.4%
if -5.0000000000000002e75 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 2e104Initial program 99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+l-99.5%
fma-neg99.6%
sub-neg99.6%
metadata-eval99.6%
neg-sub099.6%
associate-+l-99.6%
neg-sub099.6%
+-commutative99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in z around 0 96.3%
if 2e104 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 85.4%
Taylor expanded in x around 0 82.2%
Final simplification89.8%
(FPCore (x y z)
:precision binary64
(if (or (<= y -4e-93) (not (<= y 6e-126)))
(+
(+ 0.91893853320467 (- (* x (log x)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
0.91893853320467
(-
(+
(* 0.083333333333333 (/ 1.0 x))
(+ (* (log x) (- x 0.5)) (* z (* z (/ 0.0007936500793651 x)))))
x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4e-93) || !(y <= 6e-126)) {
tmp = (0.91893853320467 + ((x * log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((log(x) * (x - 0.5)) + (z * (z * (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) :: tmp
if ((y <= (-4d-93)) .or. (.not. (y <= 6d-126))) then
tmp = (0.91893853320467d0 + ((x * log(x)) - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = 0.91893853320467d0 + (((0.083333333333333d0 * (1.0d0 / x)) + ((log(x) * (x - 0.5d0)) + (z * (z * (0.0007936500793651d0 / x))))) - x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4e-93) || !(y <= 6e-126)) {
tmp = (0.91893853320467 + ((x * Math.log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((Math.log(x) * (x - 0.5)) + (z * (z * (0.0007936500793651 / x))))) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4e-93) or not (y <= 6e-126): tmp = (0.91893853320467 + ((x * math.log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((math.log(x) * (x - 0.5)) + (z * (z * (0.0007936500793651 / x))))) - x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4e-93) || !(y <= 6e-126)) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(0.91893853320467 + Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(log(x) * Float64(x - 0.5)) + Float64(z * Float64(z * Float64(0.0007936500793651 / x))))) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4e-93) || ~((y <= 6e-126))) tmp = (0.91893853320467 + ((x * log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((log(x) * (x - 0.5)) + (z * (z * (0.0007936500793651 / x))))) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4e-93], N[Not[LessEqual[y, 6e-126]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - 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[(0.91893853320467 + N[(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[(z * N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-93} \lor \neg \left(y \leq 6 \cdot 10^{-126}\right):\\
\;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \left(\left(0.083333333333333 \cdot \frac{1}{x} + \left(\log x \cdot \left(x - 0.5\right) + z \cdot \left(z \cdot \frac{0.0007936500793651}{x}\right)\right)\right) - x\right)\\
\end{array}
\end{array}
if y < -3.9999999999999996e-93 or 6.0000000000000003e-126 < y Initial program 93.5%
Taylor expanded in x around inf 93.1%
mul-1-neg93.1%
distribute-rgt-neg-in93.1%
log-rec93.1%
remove-double-neg93.1%
Simplified93.1%
if -3.9999999999999996e-93 < y < 6.0000000000000003e-126Initial program 90.3%
+-commutative90.3%
associate-+l+90.3%
associate-+l-90.3%
fma-neg90.4%
sub-neg90.4%
metadata-eval90.4%
neg-sub090.4%
associate-+l-90.4%
neg-sub090.4%
+-commutative90.4%
unsub-neg90.4%
Simplified90.4%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 90.4%
unpow290.4%
associate-*l*99.6%
distribute-rgt-in99.6%
associate-*r/99.7%
metadata-eval99.7%
associate-*l/99.7%
associate-*r/99.7%
associate-*l/99.7%
associate-/l*92.8%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in y around 0 99.7%
*-commutative99.7%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Final simplification95.4%
(FPCore (x y z)
:precision binary64
(if (<= x 4.8e+121)
(+
(+ 0.91893853320467 (- (* x (log x)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
0.91893853320467
(-
(+
(* 0.083333333333333 (/ 1.0 x))
(+ (* (log x) (- x 0.5)) (* z (* z (/ y x)))))
x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+121) {
tmp = (0.91893853320467 + ((x * log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / 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 <= 4.8d+121) then
tmp = (0.91893853320467d0 + ((x * log(x)) - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = 0.91893853320467d0 + (((0.083333333333333d0 * (1.0d0 / 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 <= 4.8e+121) {
tmp = (0.91893853320467 + ((x * Math.log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((Math.log(x) * (x - 0.5)) + (z * (z * (y / x))))) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.8e+121: tmp = (0.91893853320467 + ((x * math.log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((math.log(x) * (x - 0.5)) + (z * (z * (y / x))))) - x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.8e+121) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(0.91893853320467 + Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(log(x) * Float64(x - 0.5)) + Float64(z * Float64(z * Float64(y / x))))) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.8e+121) tmp = (0.91893853320467 + ((x * log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + ((log(x) * (x - 0.5)) + (z * (z * (y / x))))) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.8e+121], N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - 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[(0.91893853320467 + N[(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[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.8 \cdot 10^{+121}:\\
\;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \left(\left(0.083333333333333 \cdot \frac{1}{x} + \left(\log x \cdot \left(x - 0.5\right) + z \cdot \left(z \cdot \frac{y}{x}\right)\right)\right) - x\right)\\
\end{array}
\end{array}
if x < 4.8e121Initial program 98.1%
Taylor expanded in x around inf 97.2%
mul-1-neg97.2%
distribute-rgt-neg-in97.2%
log-rec97.2%
remove-double-neg97.2%
Simplified97.2%
if 4.8e121 < x Initial program 81.6%
+-commutative81.6%
associate-+l+81.6%
associate-+l-81.6%
fma-neg81.8%
sub-neg81.8%
metadata-eval81.8%
neg-sub081.8%
associate-+l-81.8%
neg-sub081.8%
+-commutative81.8%
unsub-neg81.8%
Simplified81.8%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 87.0%
unpow287.0%
associate-*l*99.5%
distribute-rgt-in99.5%
associate-*r/99.5%
metadata-eval99.5%
associate-*l/99.5%
associate-*r/99.5%
associate-*l/95.3%
associate-/l*99.4%
distribute-rgt-out99.4%
Simplified99.4%
Taylor expanded in y around inf 90.0%
*-commutative90.0%
associate-*r/94.2%
Simplified94.2%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (or (<= z -7.2e+22) (not (<= z 2.6e+33)))
(+ 0.91893853320467 (* (+ (/ y x) (/ 0.0007936500793651 x)) (pow z 2.0)))
(+
0.91893853320467
(- (+ (* 0.083333333333333 (/ 1.0 x)) (* (log x) (- x 0.5))) x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.2e+22) || !(z <= 2.6e+33)) {
tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * pow(z, 2.0));
} else {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (log(x) * (x - 0.5))) - 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 <= (-7.2d+22)) .or. (.not. (z <= 2.6d+33))) then
tmp = 0.91893853320467d0 + (((y / x) + (0.0007936500793651d0 / x)) * (z ** 2.0d0))
else
tmp = 0.91893853320467d0 + (((0.083333333333333d0 * (1.0d0 / x)) + (log(x) * (x - 0.5d0))) - x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -7.2e+22) || !(z <= 2.6e+33)) {
tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * Math.pow(z, 2.0));
} else {
tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (Math.log(x) * (x - 0.5))) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.2e+22) or not (z <= 2.6e+33): tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * math.pow(z, 2.0)) else: tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (math.log(x) * (x - 0.5))) - x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.2e+22) || !(z <= 2.6e+33)) tmp = Float64(0.91893853320467 + Float64(Float64(Float64(y / x) + Float64(0.0007936500793651 / x)) * (z ^ 2.0))); else tmp = Float64(0.91893853320467 + Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(log(x) * Float64(x - 0.5))) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -7.2e+22) || ~((z <= 2.6e+33))) tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * (z ^ 2.0)); else tmp = 0.91893853320467 + (((0.083333333333333 * (1.0 / x)) + (log(x) * (x - 0.5))) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.2e+22], N[Not[LessEqual[z, 2.6e+33]], $MachinePrecision]], N[(0.91893853320467 + N[(N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.91893853320467 + N[(N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+22} \lor \neg \left(z \leq 2.6 \cdot 10^{+33}\right):\\
\;\;\;\;0.91893853320467 + \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot {z}^{2}\\
\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \left(\left(0.083333333333333 \cdot \frac{1}{x} + \log x \cdot \left(x - 0.5\right)\right) - x\right)\\
\end{array}
\end{array}
if z < -7.2e22 or 2.5999999999999997e33 < z Initial program 85.2%
+-commutative85.2%
associate-+l+85.2%
associate-+l-85.2%
fma-neg85.3%
sub-neg85.3%
metadata-eval85.3%
neg-sub085.3%
associate-+l-85.3%
neg-sub085.3%
+-commutative85.3%
unsub-neg85.3%
Simplified85.3%
Taylor expanded in z around inf 81.5%
*-commutative81.5%
associate-*r/81.5%
metadata-eval81.5%
Simplified81.5%
if -7.2e22 < z < 2.5999999999999997e33Initial program 99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+l-99.5%
fma-neg99.6%
sub-neg99.6%
metadata-eval99.6%
neg-sub099.6%
associate-+l-99.6%
neg-sub099.6%
+-commutative99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in z around 0 90.4%
Final simplification86.0%
(FPCore (x y z)
:precision binary64
(+
0.91893853320467
(-
(+
(+ (* z (/ (+ 0.0007936500793651 y) (/ x z))) (* (log x) (- x 0.5)))
(/ 0.083333333333333 x))
x)))
double code(double x, double y, double z) {
return 0.91893853320467 + ((((z * ((0.0007936500793651 + y) / (x / z))) + (log(x) * (x - 0.5))) + (0.083333333333333 / x)) - x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.91893853320467d0 + ((((z * ((0.0007936500793651d0 + y) / (x / z))) + (log(x) * (x - 0.5d0))) + (0.083333333333333d0 / x)) - x)
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + ((((z * ((0.0007936500793651 + y) / (x / z))) + (Math.log(x) * (x - 0.5))) + (0.083333333333333 / x)) - x);
}
def code(x, y, z): return 0.91893853320467 + ((((z * ((0.0007936500793651 + y) / (x / z))) + (math.log(x) * (x - 0.5))) + (0.083333333333333 / x)) - x)
function code(x, y, z) return Float64(0.91893853320467 + Float64(Float64(Float64(Float64(z * Float64(Float64(0.0007936500793651 + y) / Float64(x / z))) + Float64(log(x) * Float64(x - 0.5))) + Float64(0.083333333333333 / x)) - x)) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + ((((z * ((0.0007936500793651 + y) / (x / z))) + (log(x) * (x - 0.5))) + (0.083333333333333 / x)) - x); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(N[(N[(N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + \left(\left(\left(z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}} + \log x \cdot \left(x - 0.5\right)\right) + \frac{0.083333333333333}{x}\right) - x\right)
\end{array}
Initial program 92.4%
+-commutative92.4%
associate-+l+92.4%
associate-+l-92.4%
fma-neg92.5%
sub-neg92.5%
metadata-eval92.5%
neg-sub092.5%
associate-+l-92.5%
neg-sub092.5%
+-commutative92.5%
unsub-neg92.5%
Simplified92.5%
Taylor expanded in z around 0 93.2%
Taylor expanded in z around inf 87.6%
unpow287.6%
associate-*l*93.0%
distribute-rgt-in90.7%
associate-*r/90.7%
metadata-eval90.7%
associate-*l/90.7%
associate-*r/90.7%
associate-*l/95.3%
associate-/l*94.0%
distribute-rgt-out99.0%
Simplified99.0%
*-commutative99.0%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 99.1%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(+
0.91893853320467
(-
(+
(/ 0.083333333333333 x)
(+ (* (log x) (- x 0.5)) (* z (* (+ 0.0007936500793651 y) (/ z x)))))
x)))
double code(double x, double y, double z) {
return 0.91893853320467 + (((0.083333333333333 / x) + ((log(x) * (x - 0.5)) + (z * ((0.0007936500793651 + y) * (z / 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 / x) + ((log(x) * (x - 0.5d0)) + (z * ((0.0007936500793651d0 + y) * (z / x))))) - x)
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + (((0.083333333333333 / x) + ((Math.log(x) * (x - 0.5)) + (z * ((0.0007936500793651 + y) * (z / x))))) - x);
}
def code(x, y, z): return 0.91893853320467 + (((0.083333333333333 / x) + ((math.log(x) * (x - 0.5)) + (z * ((0.0007936500793651 + y) * (z / x))))) - x)
function code(x, y, z) return Float64(0.91893853320467 + Float64(Float64(Float64(0.083333333333333 / x) + Float64(Float64(log(x) * Float64(x - 0.5)) + Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x))))) - x)) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + (((0.083333333333333 / x) + ((log(x) * (x - 0.5)) + (z * ((0.0007936500793651 + y) * (z / x))))) - x); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + \left(\left(\frac{0.083333333333333}{x} + \left(\log x \cdot \left(x - 0.5\right) + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right)\right) - x\right)
\end{array}
Initial program 92.4%
+-commutative92.4%
associate-+l+92.4%
associate-+l-92.4%
fma-neg92.5%
sub-neg92.5%
metadata-eval92.5%
neg-sub092.5%
associate-+l-92.5%
neg-sub092.5%
+-commutative92.5%
unsub-neg92.5%
Simplified92.5%
Taylor expanded in z around 0 93.2%
Taylor expanded in z around inf 87.6%
unpow287.6%
associate-*l*93.0%
distribute-rgt-in90.7%
associate-*r/90.7%
metadata-eval90.7%
associate-*l/90.7%
associate-*r/90.7%
associate-*l/95.3%
associate-/l*94.0%
distribute-rgt-out99.0%
Simplified99.0%
Taylor expanded in x around 0 99.0%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.75e+22) (not (<= z 2.5e+33))) (+ 0.91893853320467 (* (+ (/ y x) (/ 0.0007936500793651 x)) (pow z 2.0))) (+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.75e+22) || !(z <= 2.5e+33)) {
tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * pow(z, 2.0));
} else {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(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.75d+22)) .or. (.not. (z <= 2.5d+33))) then
tmp = 0.91893853320467d0 + (((y / x) + (0.0007936500793651d0 / x)) * (z ** 2.0d0))
else
tmp = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((x * log(x)) - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.75e+22) || !(z <= 2.5e+33)) {
tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * Math.pow(z, 2.0));
} else {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.75e+22) or not (z <= 2.5e+33): tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * math.pow(z, 2.0)) else: tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * math.log(x)) - x)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.75e+22) || !(z <= 2.5e+33)) tmp = Float64(0.91893853320467 + Float64(Float64(Float64(y / x) + Float64(0.0007936500793651 / x)) * (z ^ 2.0))); else tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.75e+22) || ~((z <= 2.5e+33))) tmp = 0.91893853320467 + (((y / x) + (0.0007936500793651 / x)) * (z ^ 2.0)); else tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.75e+22], N[Not[LessEqual[z, 2.5e+33]], $MachinePrecision]], N[(0.91893853320467 + N[(N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+22} \lor \neg \left(z \leq 2.5 \cdot 10^{+33}\right):\\
\;\;\;\;0.91893853320467 + \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot {z}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\end{array}
\end{array}
if z < -1.75e22 or 2.49999999999999986e33 < z Initial program 85.2%
+-commutative85.2%
associate-+l+85.2%
associate-+l-85.2%
fma-neg85.3%
sub-neg85.3%
metadata-eval85.3%
neg-sub085.3%
associate-+l-85.3%
neg-sub085.3%
+-commutative85.3%
unsub-neg85.3%
Simplified85.3%
Taylor expanded in z around inf 81.5%
*-commutative81.5%
associate-*r/81.5%
metadata-eval81.5%
Simplified81.5%
if -1.75e22 < z < 2.49999999999999986e33Initial program 99.5%
Taylor expanded in x around inf 98.4%
mul-1-neg98.4%
distribute-rgt-neg-in98.4%
log-rec98.4%
remove-double-neg98.4%
Simplified98.4%
Taylor expanded in z around 0 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in z around 0 89.2%
Final simplification85.4%
(FPCore (x y z)
:precision binary64
(+
(+ 0.91893853320467 (- (* x (log x)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((x * log(x)) - x)) + ((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.91893853320467d0 + ((x * log(x)) - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((x * Math.log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z): return (0.91893853320467 + ((x * math.log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + 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.91893853320467 + ((x * log(x)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - 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]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 92.4%
Taylor expanded in x around inf 91.9%
mul-1-neg91.9%
distribute-rgt-neg-in91.9%
log-rec91.9%
remove-double-neg91.9%
Simplified91.9%
Final simplification91.9%
(FPCore (x y z) :precision binary64 (+ (/ 0.083333333333333 x) (+ 0.91893853320467 (- (* x (log x)) x))))
double code(double x, double y, double z) {
return (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 / x) + (0.91893853320467d0 + ((x * log(x)) - x))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
}
def code(x, y, z): return (0.083333333333333 / x) + (0.91893853320467 + ((x * math.log(x)) - x))
function code(x, y, z) return Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))) end
function tmp = code(x, y, z) tmp = (0.083333333333333 / x) + (0.91893853320467 + ((x * log(x)) - x)); end
code[x_, y_, z_] := N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)
\end{array}
Initial program 92.4%
Taylor expanded in x around inf 91.9%
mul-1-neg91.9%
distribute-rgt-neg-in91.9%
log-rec91.9%
remove-double-neg91.9%
Simplified91.9%
Taylor expanded in z around 0 60.1%
*-commutative60.1%
Simplified60.1%
Taylor expanded in z around 0 52.3%
Final simplification52.3%
(FPCore (x y z) :precision binary64 (+ 0.91893853320467 (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return 0.91893853320467 + (x * (log(x) + -1.0));
}
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 + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return 0.91893853320467 + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return 0.91893853320467 + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = 0.91893853320467 + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.91893853320467 + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 92.4%
+-commutative92.4%
associate-+l+92.4%
associate-+l-92.4%
fma-neg92.5%
sub-neg92.5%
metadata-eval92.5%
neg-sub092.5%
associate-+l-92.5%
neg-sub092.5%
+-commutative92.5%
unsub-neg92.5%
Simplified92.5%
Taylor expanded in x around inf 33.4%
sub-neg33.4%
mul-1-neg33.4%
log-rec33.4%
remove-double-neg33.4%
metadata-eval33.4%
Simplified33.4%
(FPCore (x y z) :precision binary64 0.91893853320467)
double code(double x, double y, double z) {
return 0.91893853320467;
}
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
end function
public static double code(double x, double y, double z) {
return 0.91893853320467;
}
def code(x, y, z): return 0.91893853320467
function code(x, y, z) return 0.91893853320467 end
function tmp = code(x, y, z) tmp = 0.91893853320467; end
code[x_, y_, z_] := 0.91893853320467
\begin{array}{l}
\\
0.91893853320467
\end{array}
Initial program 92.4%
+-commutative92.4%
associate-+l+92.4%
associate-+l-92.4%
fma-neg92.5%
sub-neg92.5%
metadata-eval92.5%
neg-sub092.5%
associate-+l-92.5%
neg-sub092.5%
+-commutative92.5%
unsub-neg92.5%
Simplified92.5%
Taylor expanded in x around inf 33.4%
sub-neg33.4%
mul-1-neg33.4%
log-rec33.4%
remove-double-neg33.4%
metadata-eval33.4%
Simplified33.4%
Taylor expanded in x around 0 3.8%
(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 2024096
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))