
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 3.1e+33)
(/
(+
0.083333333333333
(+
(* x (+ 0.91893853320467 (+ (* -0.5 (log x)) (* x (+ (log x) -1.0)))))
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
x)
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* (log x) (- x 0.5)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.1e+33) {
tmp = (0.083333333333333 + ((x * (0.91893853320467 + ((-0.5 * log(x)) + (x * (log(x) + -1.0))))) + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))) / x;
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-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 (x <= 3.1d+33) then
tmp = (0.083333333333333d0 + ((x * (0.91893853320467d0 + (((-0.5d0) * log(x)) + (x * (log(x) + (-1.0d0)))))) + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0)))) / x
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + ((z * ((z * ((0.0007936500793651d0 * (1.0d0 / x)) + (y / x))) + (0.0027777777777778d0 * ((-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 (x <= 3.1e+33) {
tmp = (0.083333333333333 + ((x * (0.91893853320467 + ((-0.5 * Math.log(x)) + (x * (Math.log(x) + -1.0))))) + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))) / x;
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (Math.log(x) * (x - 0.5))))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.1e+33: tmp = (0.083333333333333 + ((x * (0.91893853320467 + ((-0.5 * math.log(x)) + (x * (math.log(x) + -1.0))))) + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))) / x else: tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (math.log(x) * (x - 0.5))))) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.1e+33) tmp = Float64(Float64(0.083333333333333 + Float64(Float64(x * Float64(0.91893853320467 + Float64(Float64(-0.5 * log(x)) + Float64(x * Float64(log(x) + -1.0))))) + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)))) / x); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * 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 (x <= 3.1e+33) tmp = (0.083333333333333 + ((x * (0.91893853320467 + ((-0.5 * log(x)) + (x * (log(x) + -1.0))))) + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)))) / x; else tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (log(x) * (x - 0.5))))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.1e+33], N[(N[(0.083333333333333 + N[(N[(x * N[(0.91893853320467 + N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.1 \cdot 10^{+33}:\\
\;\;\;\;\frac{0.083333333333333 + \left(x \cdot \left(0.91893853320467 + \left(-0.5 \cdot \log x + x \cdot \left(\log x + -1\right)\right)\right) + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + \log x \cdot \left(x - 0.5\right)\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 3.1e33Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if 3.1e33 < x Initial program 91.5%
associate-+l+91.5%
fma-neg91.5%
sub-neg91.5%
metadata-eval91.5%
fma-define91.5%
fma-neg91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in z around 0 99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 500000000000.0)
(+
(- (+ 0.91893853320467 (* (log x) (+ x -0.5))) x)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* (log x) (- x 0.5)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 500000000000.0) {
tmp = ((0.91893853320467 + (log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-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 (x <= 500000000000.0d0) then
tmp = ((0.91893853320467d0 + (log(x) * (x + (-0.5d0)))) - x) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + ((z * ((z * ((0.0007936500793651d0 * (1.0d0 / x)) + (y / x))) + (0.0027777777777778d0 * ((-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 (x <= 500000000000.0) {
tmp = ((0.91893853320467 + (Math.log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (Math.log(x) * (x - 0.5))))) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 500000000000.0: tmp = ((0.91893853320467 + (math.log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (math.log(x) * (x - 0.5))))) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 500000000000.0) tmp = Float64(Float64(Float64(0.91893853320467 + Float64(log(x) * Float64(x + -0.5))) - 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 * Float64(1.0 / x)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * 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 (x <= 500000000000.0) tmp = ((0.91893853320467 + (log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (log(x) * (x - 0.5))))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 500000000000.0], N[(N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $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 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 500000000000:\\
\;\;\;\;\left(\left(0.91893853320467 + \log x \cdot \left(x + -0.5\right)\right) - x\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + \log x \cdot \left(x - 0.5\right)\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 5e11Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
Applied egg-rr99.7%
if 5e11 < x Initial program 92.7%
associate-+l+92.7%
fma-neg92.8%
sub-neg92.8%
metadata-eval92.8%
fma-define92.8%
fma-neg92.8%
metadata-eval92.8%
Simplified92.8%
Taylor expanded in z around 0 99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(+
(- (+ 0.91893853320467 (* (log x) (+ x -0.5))) x)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
return ((0.91893853320467 + (log(x) * (x + -0.5))) - 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 + (log(x) * (x + (-0.5d0)))) - 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 + (Math.log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z): return ((0.91893853320467 + (math.log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z) return Float64(Float64(Float64(0.91893853320467 + Float64(log(x) * Float64(x + -0.5))) - 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 + (log(x) * (x + -0.5))) - x) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); end
code[x_, y_, z_] := N[(N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $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(\left(0.91893853320467 + \log x \cdot \left(x + -0.5\right)\right) - x\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
sub-neg96.7%
metadata-eval96.7%
*-commutative96.7%
Applied egg-rr96.7%
Final simplification96.7%
(FPCore (x y z)
:precision binary64
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((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.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x))
end function
public static double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x));
}
def code(x, y, z): return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x))
function code(x, y, z) return Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) end
function tmp = code(x, y, z) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x)); end
code[x_, y_, z_] := N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)
\end{array}
Initial program 96.7%
Final simplification96.7%
(FPCore (x y z)
:precision binary64
(if (<= x 1.4e+15)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+
(* x (+ (log x) -1.0))
(/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.4e+15) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * y) - 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 (x <= 1.4d+15) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.4e+15) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.4e+15: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.4e+15) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.4e+15) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.4e+15], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if x < 1.4e15Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 95.3%
if 1.4e15 < x Initial program 92.6%
add-sqr-sqrt92.3%
pow292.3%
sub-neg92.3%
metadata-eval92.3%
*-commutative92.3%
Applied egg-rr92.3%
Taylor expanded in x around inf 92.6%
sub-neg92.6%
mul-1-neg92.6%
log-rec92.6%
remove-double-neg92.6%
metadata-eval92.6%
Simplified92.6%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Final simplification93.2%
(FPCore (x y z)
:precision binary64
(if (<= x 300.0)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+
(* x (+ (log x) -1.0))
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 300.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (x * (log(x) + -1.0)) + ((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 (x <= 300.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = (x * (log(x) + (-1.0d0))) + ((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 (x <= 300.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 300.0: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 300.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + 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 (x <= 300.0) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 300.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 300:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if x < 300Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 98.2%
if 300 < x Initial program 93.1%
add-sqr-sqrt92.8%
pow292.8%
sub-neg92.8%
metadata-eval92.8%
*-commutative92.8%
Applied egg-rr92.8%
Taylor expanded in x around inf 91.2%
sub-neg91.2%
mul-1-neg91.2%
log-rec91.2%
remove-double-neg91.2%
metadata-eval91.2%
Simplified91.2%
Taylor expanded in y around 0 85.2%
Final simplification92.3%
(FPCore (x y z)
:precision binary64
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (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.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := 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]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 96.7%
add-sqr-sqrt96.6%
pow296.6%
sub-neg96.6%
metadata-eval96.6%
*-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in x around inf 95.0%
sub-neg95.0%
mul-1-neg95.0%
log-rec95.0%
remove-double-neg95.0%
metadata-eval95.0%
Simplified95.0%
Final simplification95.0%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00122)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+
(- (+ 0.91893853320467 (* (log x) (+ x -0.5))) x)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00122) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = ((0.91893853320467 + (log(x) * (x + -0.5))) - x) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.00122d0) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = ((0.91893853320467d0 + (log(x) * (x + (-0.5d0)))) - x) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.00122) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = ((0.91893853320467 + (Math.log(x) * (x + -0.5))) - x) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.00122: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = ((0.91893853320467 + (math.log(x) * (x + -0.5))) - x) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.00122) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(log(x) * Float64(x + -0.5))) - x) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.00122) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = ((0.91893853320467 + (log(x) * (x + -0.5))) - x) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.00122], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00122:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \log x \cdot \left(x + -0.5\right)\right) - x\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 0.00121999999999999995Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.3%
if 0.00121999999999999995 < x Initial program 93.2%
+-commutative93.2%
associate-+r-93.2%
sub-neg93.2%
metadata-eval93.2%
*-commutative93.2%
Applied egg-rr93.2%
Taylor expanded in z around 0 76.3%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00058)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00058) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.00058d0) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.00058) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.00058: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.00058) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.00058) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.00058], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00058:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 5.8e-4Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.3%
if 5.8e-4 < x Initial program 93.2%
Taylor expanded in z around 0 76.3%
Final simplification88.7%
(FPCore (x y z)
:precision binary64
(if (<= x 4.8e+17)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+17) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4.8d+17) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.8e+17) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.8e+17: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.8e+17) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.8e+17) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.8e+17], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.8 \cdot 10^{+17}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 4.8e17Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 94.9%
if 4.8e17 < x Initial program 92.5%
associate-+l+92.5%
fma-neg92.5%
sub-neg92.5%
metadata-eval92.5%
fma-define92.5%
fma-neg92.5%
metadata-eval92.5%
Simplified92.5%
Taylor expanded in x around inf 78.3%
sub-neg78.3%
mul-1-neg78.3%
log-rec78.3%
remove-double-neg78.3%
metadata-eval78.3%
Simplified78.3%
(FPCore (x y z)
:precision binary64
(if (or (<= y -0.00078) (not (<= y 4e-63)))
(/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x)
(/
(+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00078) || !(y <= 4e-63)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-0.00078d0)) .or. (.not. (y <= 4d-63))) then
tmp = (0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x
else
tmp = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00078) || !(y <= 4e-63)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.00078) or not (y <= 4e-63): tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x else: tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.00078) || !(y <= 4e-63)) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x); else tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.00078) || ~((y <= 4e-63))) tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x; else tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00078], N[Not[LessEqual[y, 4e-63]], $MachinePrecision]], N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00078 \lor \neg \left(y \leq 4 \cdot 10^{-63}\right):\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -7.79999999999999986e-4 or 4.00000000000000027e-63 < y Initial program 96.7%
associate-+l+96.7%
fma-neg96.8%
sub-neg96.8%
metadata-eval96.8%
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 68.7%
*-commutative68.7%
Simplified68.7%
if -7.79999999999999986e-4 < y < 4.00000000000000027e-63Initial program 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 59.5%
Taylor expanded in y around 0 59.5%
Final simplification64.2%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* y (+ z (* 0.0007936500793651 (/ z y)))) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((y * (z + (0.0007936500793651 * (z / 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 * ((y * (z + (0.0007936500793651d0 * (z / y)))) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((y * (z + (0.0007936500793651 * (z / y)))) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((y * (z + (0.0007936500793651 * (z / y)))) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(y * Float64(z + Float64(0.0007936500793651 * Float64(z / y)))) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((y * (z + (0.0007936500793651 * (z / y)))) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(y * N[(z + N[(0.0007936500793651 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(y \cdot \left(z + 0.0007936500793651 \cdot \frac{z}{y}\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 64.4%
Taylor expanded in y around inf 64.5%
(FPCore (x y z)
:precision binary64
(if (<= y -2e+25)
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)
(/
(+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2e+25) {
tmp = (0.083333333333333 + (z * -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 <= (-2d+25)) then
tmp = (0.083333333333333d0 + (z * (-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 <= -2e+25) {
tmp = (0.083333333333333 + (z * -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 <= -2e+25: tmp = (0.083333333333333 + (z * -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 <= -2e+25) tmp = Float64(Float64(0.083333333333333 + Float64(z * -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 <= -2e+25) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; else tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2e+25], N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $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 \cdot 10^{+25}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -2.00000000000000018e25Initial program 94.7%
associate-+l+94.7%
fma-neg94.8%
sub-neg94.8%
metadata-eval94.8%
fma-define94.8%
fma-neg94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in x around 0 67.4%
Taylor expanded in z around 0 26.2%
+-commutative26.2%
*-commutative26.2%
Simplified26.2%
if -2.00000000000000018e25 < y Initial 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.5%
Taylor expanded in y around 0 59.3%
Final simplification51.8%
(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 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 64.4%
(FPCore (x y z) :precision binary64 (+ (* 0.083333333333333 (/ 1.0 x)) (* -0.0027777777777778 (/ z x))))
double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / 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)) + ((-0.0027777777777778d0) * (z / x))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / x));
}
def code(x, y, z): return (0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / x))
function code(x, y, z) return Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(-0.0027777777777778 * Float64(z / x))) end
function tmp = code(x, y, z) tmp = (0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / x)); end
code[x_, y_, z_] := N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x} + -0.0027777777777778 \cdot \frac{z}{x}
\end{array}
Initial program 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 64.4%
Taylor expanded in z around 0 32.9%
Final simplification32.9%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * -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 * (-0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * -0.0027777777777778)) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Initial program 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 64.4%
Taylor expanded in z around 0 32.2%
+-commutative32.2%
*-commutative32.2%
Simplified32.2%
Final simplification32.2%
(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 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 64.4%
Taylor expanded in z around 0 24.6%
div-inv24.6%
Applied egg-rr24.6%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 96.7%
associate-+l+96.7%
fma-neg96.7%
sub-neg96.7%
metadata-eval96.7%
fma-define96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in x around 0 64.4%
Taylor expanded in z around 0 24.6%
(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 2024141
(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)))