
(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 15 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 1.6e+21)
(+
(+
(- (/ (* (+ (pow x 3.0) -0.125) (log x)) (fma x x (- 0.25 (* x -0.5)))) x)
0.91893853320467)
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+
(+
(+ 0.91893853320467 (/ 0.083333333333333 x))
(- (* (log x) (+ x -0.5)) x))
(* z (/ -1.0 (/ (/ (- x) z) (+ y 0.0007936500793651)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.6e+21) {
tmp = (((((pow(x, 3.0) + -0.125) * log(x)) / fma(x, x, (0.25 - (x * -0.5)))) - x) + 0.91893853320467) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z * (-1.0 / ((-x / z) / (y + 0.0007936500793651))));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.6e+21) tmp = Float64(Float64(Float64(Float64(Float64(Float64((x ^ 3.0) + -0.125) * log(x)) / fma(x, x, Float64(0.25 - Float64(x * -0.5)))) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(z * Float64(-1.0 / Float64(Float64(Float64(-x) / z) / Float64(y + 0.0007936500793651))))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.6e+21], N[(N[(N[(N[(N[(N[(N[Power[x, 3.0], $MachinePrecision] + -0.125), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] / N[(x * x + N[(0.25 - N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-1.0 / N[(N[((-x) / z), $MachinePrecision] / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.6 \cdot 10^{+21}:\\
\;\;\;\;\left(\left(\frac{\left({x}^{3} + -0.125\right) \cdot \log x}{\mathsf{fma}\left(x, x, 0.25 - x \cdot -0.5\right)} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \frac{-1}{\frac{\frac{-x}{z}}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if x < 1.6e21Initial program 99.8%
sub-neg99.8%
metadata-eval99.8%
flip3-+99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
sub-neg99.7%
associate-*l/99.8%
sub-neg99.8%
metadata-eval99.8%
metadata-eval99.8%
fma-def99.8%
metadata-eval99.8%
Applied egg-rr99.8%
if 1.6e21 < x Initial program 81.4%
clear-num81.4%
inv-pow81.4%
*-commutative81.4%
fma-udef81.4%
fma-neg81.4%
metadata-eval81.4%
Applied egg-rr81.4%
Taylor expanded in x around 0 81.4%
Simplified95.5%
frac-2neg95.5%
div-inv95.5%
distribute-neg-frac95.5%
Applied egg-rr95.5%
Taylor expanded in z around inf 95.5%
mul-1-neg95.5%
associate-/r*98.7%
distribute-neg-frac98.7%
Simplified98.7%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
(if (<= t_0 2e+307)
t_0
(+
(+
(+ 0.91893853320467 (/ 0.083333333333333 x))
(- (* (log x) (+ x -0.5)) x))
(/ z (/ x (- (* 0.0007936500793651 z) 0.0027777777777778)))))))
double code(double x, double y, double z) {
double t_0 = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
double tmp;
if (t_0 <= 2e+307) {
tmp = t_0;
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x))
if (t_0 <= 2d+307) then
tmp = t_0
else
tmp = ((0.91893853320467d0 + (0.083333333333333d0 / x)) + ((log(x) * (x + (-0.5d0))) - x)) + (z / (x / ((0.0007936500793651d0 * z) - 0.0027777777777778d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x));
double tmp;
if (t_0 <= 2e+307) {
tmp = t_0;
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((Math.log(x) * (x + -0.5)) - x)) + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778)));
}
return tmp;
}
def code(x, y, z): t_0 = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) tmp = 0 if t_0 <= 2e+307: tmp = t_0 else: tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((math.log(x) * (x + -0.5)) - x)) + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))) tmp = 0.0 if (t_0 <= 2e+307) tmp = t_0; else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(z / Float64(x / Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x)); tmp = 0.0; if (t_0 <= 2e+307) tmp = t_0; else tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $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]}, If[LessEqual[t$95$0, 2e+307], t$95$0, N[(N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z / N[(x / N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{z}{\frac{x}{0.0007936500793651 \cdot z - 0.0027777777777778}}\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x) 91893853320467/100000000000000) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) < 1.99999999999999997e307Initial program 98.1%
if 1.99999999999999997e307 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x) 91893853320467/100000000000000) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) Initial program 68.1%
clear-num68.1%
inv-pow68.1%
*-commutative68.1%
fma-udef68.1%
fma-neg68.1%
metadata-eval68.1%
Applied egg-rr68.1%
Taylor expanded in x around 0 68.1%
Simplified94.9%
Taylor expanded in y around 0 91.7%
Final simplification96.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ 0.91893853320467 (/ 0.083333333333333 x))
(- (* (log x) (+ x -0.5)) x))))
(if (or (<= (+ y 0.0007936500793651) -0.1)
(not (<= (+ y 0.0007936500793651) 0.0007936500795)))
(+ t_0 (/ z (/ x (* y z))))
(+ t_0 (/ z (/ x (- (* 0.0007936500793651 z) 0.0027777777777778)))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x);
double tmp;
if (((y + 0.0007936500793651) <= -0.1) || !((y + 0.0007936500793651) <= 0.0007936500795)) {
tmp = t_0 + (z / (x / (y * z)));
} else {
tmp = t_0 + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (0.91893853320467d0 + (0.083333333333333d0 / x)) + ((log(x) * (x + (-0.5d0))) - x)
if (((y + 0.0007936500793651d0) <= (-0.1d0)) .or. (.not. ((y + 0.0007936500793651d0) <= 0.0007936500795d0))) then
tmp = t_0 + (z / (x / (y * z)))
else
tmp = t_0 + (z / (x / ((0.0007936500793651d0 * z) - 0.0027777777777778d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (0.083333333333333 / x)) + ((Math.log(x) * (x + -0.5)) - x);
double tmp;
if (((y + 0.0007936500793651) <= -0.1) || !((y + 0.0007936500793651) <= 0.0007936500795)) {
tmp = t_0 + (z / (x / (y * z)));
} else {
tmp = t_0 + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778)));
}
return tmp;
}
def code(x, y, z): t_0 = (0.91893853320467 + (0.083333333333333 / x)) + ((math.log(x) * (x + -0.5)) - x) tmp = 0 if ((y + 0.0007936500793651) <= -0.1) or not ((y + 0.0007936500793651) <= 0.0007936500795): tmp = t_0 + (z / (x / (y * z))) else: tmp = t_0 + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778))) return tmp
function code(x, y, z) t_0 = Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) tmp = 0.0 if ((Float64(y + 0.0007936500793651) <= -0.1) || !(Float64(y + 0.0007936500793651) <= 0.0007936500795)) tmp = Float64(t_0 + Float64(z / Float64(x / Float64(y * z)))); else tmp = Float64(t_0 + Float64(z / Float64(x / Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x); tmp = 0.0; if (((y + 0.0007936500793651) <= -0.1) || ~(((y + 0.0007936500793651) <= 0.0007936500795))) tmp = t_0 + (z / (x / (y * z))); else tmp = t_0 + (z / (x / ((0.0007936500793651 * z) - 0.0027777777777778))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -0.1], N[Not[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.0007936500795]], $MachinePrecision]], N[(t$95$0 + N[(z / N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z / N[(x / N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
\mathbf{if}\;y + 0.0007936500793651 \leq -0.1 \lor \neg \left(y + 0.0007936500793651 \leq 0.0007936500795\right):\\
\;\;\;\;t\_0 + \frac{z}{\frac{x}{y \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{z}{\frac{x}{0.0007936500793651 \cdot z - 0.0027777777777778}}\\
\end{array}
\end{array}
if (+.f64 y 7936500793651/10000000000000000) < -0.10000000000000001 or 7.9365007950000003e-4 < (+.f64 y 7936500793651/10000000000000000) Initial program 91.3%
clear-num91.2%
inv-pow91.2%
*-commutative91.2%
fma-udef91.2%
fma-neg91.2%
metadata-eval91.2%
Applied egg-rr91.2%
Taylor expanded in x around 0 91.3%
Simplified93.3%
Taylor expanded in y around inf 93.3%
*-commutative93.3%
Simplified93.3%
if -0.10000000000000001 < (+.f64 y 7936500793651/10000000000000000) < 7.9365007950000003e-4Initial program 91.4%
clear-num91.4%
inv-pow91.4%
*-commutative91.4%
fma-udef91.4%
fma-neg91.4%
metadata-eval91.4%
Applied egg-rr91.4%
Taylor expanded in x around 0 91.3%
Simplified99.6%
Taylor expanded in y around 0 99.4%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (<= x 1e+34)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))
(+
(+
(+ 0.91893853320467 (/ 0.083333333333333 x))
(- (* (log x) (+ x -0.5)) x))
(* z (/ -1.0 (/ (/ (- x) z) (+ y 0.0007936500793651)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1e+34) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z * (-1.0 / ((-x / z) / (y + 0.0007936500793651))));
}
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 <= 1d+34) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x))
else
tmp = ((0.91893853320467d0 + (0.083333333333333d0 / x)) + ((log(x) * (x + (-0.5d0))) - x)) + (z * ((-1.0d0) / ((-x / z) / (y + 0.0007936500793651d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1e+34) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x));
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((Math.log(x) * (x + -0.5)) - x)) + (z * (-1.0 / ((-x / z) / (y + 0.0007936500793651))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1e+34: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) else: tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((math.log(x) * (x + -0.5)) - x)) + (z * (-1.0 / ((-x / z) / (y + 0.0007936500793651)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1e+34) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))); else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(z * Float64(-1.0 / Float64(Float64(Float64(-x) / z) / Float64(y + 0.0007936500793651))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1e+34) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x)); else tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z * (-1.0 / ((-x / z) / (y + 0.0007936500793651)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1e+34], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $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], N[(N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-1.0 / N[(N[((-x) / z), $MachinePrecision] / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+34}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \frac{-1}{\frac{\frac{-x}{z}}{y + 0.0007936500793651}}\\
\end{array}
\end{array}
if x < 9.99999999999999946e33Initial program 99.7%
if 9.99999999999999946e33 < x Initial program 80.8%
clear-num80.8%
inv-pow80.8%
*-commutative80.8%
fma-udef80.8%
fma-neg80.8%
metadata-eval80.8%
Applied egg-rr80.8%
Taylor expanded in x around 0 80.8%
Simplified95.3%
frac-2neg95.3%
div-inv95.3%
distribute-neg-frac95.3%
Applied egg-rr95.3%
Taylor expanded in z around inf 95.3%
mul-1-neg95.3%
associate-/r*98.7%
distribute-neg-frac98.7%
Simplified98.7%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(if (<= x 4100000000000.0)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+
(+
(+ 0.91893853320467 (/ 0.083333333333333 x))
(- (* (log x) (+ x -0.5)) x))
(/ z (/ 1.0 (/ z (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4100000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z / (1.0 / (z / (x / y))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4100000000000.0d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = ((0.91893853320467d0 + (0.083333333333333d0 / x)) + ((log(x) * (x + (-0.5d0))) - x)) + (z / (1.0d0 / (z / (x / y))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4100000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((Math.log(x) * (x + -0.5)) - x)) + (z / (1.0 / (z / (x / y))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4100000000000.0: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((math.log(x) * (x + -0.5)) - x)) + (z / (1.0 / (z / (x / y)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4100000000000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(z / Float64(1.0 / Float64(z / Float64(x / y))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4100000000000.0) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z / (1.0 / (z / (x / y)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4100000000000.0], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z / N[(1.0 / N[(z / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4100000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{z}{\frac{1}{\frac{z}{\frac{x}{y}}}}\\
\end{array}
\end{array}
if x < 4.1e12Initial program 99.8%
Taylor expanded in x around 0 97.7%
if 4.1e12 < x Initial program 82.0%
clear-num82.0%
inv-pow82.0%
*-commutative82.0%
fma-udef82.0%
fma-neg82.0%
metadata-eval82.0%
Applied egg-rr82.0%
Taylor expanded in x around 0 82.0%
Simplified95.6%
Taylor expanded in y around inf 85.4%
*-commutative85.4%
Simplified85.4%
clear-num85.4%
inv-pow85.4%
Applied egg-rr85.4%
unpow-185.4%
associate-/l*88.6%
Simplified88.6%
Final simplification93.3%
(FPCore (x y z)
:precision binary64
(if (<= x 2100000000000.0)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+
(+
(+ 0.91893853320467 (/ 0.083333333333333 x))
(- (* (log x) (+ x -0.5)) x))
(/ z (/ x (* y z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2100000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z / (x / (y * z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2100000000000.0d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = ((0.91893853320467d0 + (0.083333333333333d0 / x)) + ((log(x) * (x + (-0.5d0))) - x)) + (z / (x / (y * z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2100000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((Math.log(x) * (x + -0.5)) - x)) + (z / (x / (y * z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2100000000000.0: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((math.log(x) * (x + -0.5)) - x)) + (z / (x / (y * z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2100000000000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(z / Float64(x / Float64(y * z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2100000000000.0) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = ((0.91893853320467 + (0.083333333333333 / x)) + ((log(x) * (x + -0.5)) - x)) + (z / (x / (y * z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2100000000000.0], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z / N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2100000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{z}{\frac{x}{y \cdot z}}\\
\end{array}
\end{array}
if x < 2.1e12Initial program 99.8%
Taylor expanded in x around 0 97.7%
if 2.1e12 < x Initial program 82.0%
clear-num82.0%
inv-pow82.0%
*-commutative82.0%
fma-udef82.0%
fma-neg82.0%
metadata-eval82.0%
Applied egg-rr82.0%
Taylor expanded in x around 0 82.0%
Simplified95.6%
Taylor expanded in y around inf 85.4%
*-commutative85.4%
Simplified85.4%
Final simplification91.8%
(FPCore (x y z)
:precision binary64
(if (<= x 2800000000000.0)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2800000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = 0.91893853320467 + ((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 <= 2800000000000.0d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = 0.91893853320467d0 + ((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 <= 2800000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = 0.91893853320467 + ((Math.log(x) * (x + -0.5)) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2800000000000.0: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = 0.91893853320467 + ((math.log(x) * (x + -0.5)) - x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2800000000000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x + -0.5)) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2800000000000.0) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = 0.91893853320467 + ((log(x) * (x + -0.5)) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2800000000000.0], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2800000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
\end{array}
\end{array}
if x < 2.8e12Initial program 99.8%
Taylor expanded in x around 0 97.7%
if 2.8e12 < x Initial program 82.0%
clear-num82.0%
inv-pow82.0%
*-commutative82.0%
fma-udef82.0%
fma-neg82.0%
metadata-eval82.0%
Applied egg-rr82.0%
Taylor expanded in x around inf 74.3%
sub-neg74.3%
mul-1-neg74.3%
log-rec74.3%
remove-double-neg74.3%
metadata-eval74.3%
distribute-rgt-in74.3%
*-commutative74.3%
neg-mul-174.3%
associate-+r+74.3%
Simplified74.3%
Final simplification86.5%
(FPCore (x y z)
:precision binary64
(if (<= x 2100000000000.0)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+
(/ z (/ x (* y z)))
(+ (+ 0.91893853320467 (/ 0.083333333333333 x)) (- (* x (log x)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2100000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = (z / (x / (y * z))) + ((0.91893853320467 + (0.083333333333333 / x)) + ((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 (x <= 2100000000000.0d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = (z / (x / (y * z))) + ((0.91893853320467d0 + (0.083333333333333d0 / x)) + ((x * log(x)) - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2100000000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = (z / (x / (y * z))) + ((0.91893853320467 + (0.083333333333333 / x)) + ((x * Math.log(x)) - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2100000000000.0: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = (z / (x / (y * z))) + ((0.91893853320467 + (0.083333333333333 / x)) + ((x * math.log(x)) - x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2100000000000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(z / Float64(x / Float64(y * z))) + Float64(Float64(0.91893853320467 + Float64(0.083333333333333 / x)) + Float64(Float64(x * log(x)) - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2100000000000.0) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = (z / (x / (y * z))) + ((0.91893853320467 + (0.083333333333333 / x)) + ((x * log(x)) - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2100000000000.0], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.91893853320467 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2100000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{x}{y \cdot z}} + \left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \left(x \cdot \log x - x\right)\right)\\
\end{array}
\end{array}
if x < 2.1e12Initial program 99.8%
Taylor expanded in x around 0 97.7%
if 2.1e12 < x Initial program 82.0%
clear-num82.0%
inv-pow82.0%
*-commutative82.0%
fma-udef82.0%
fma-neg82.0%
metadata-eval82.0%
Applied egg-rr82.0%
Taylor expanded in x around 0 82.0%
Simplified95.6%
Taylor expanded in y around inf 85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in x around inf 85.3%
mul-1-neg85.3%
distribute-rgt-neg-in85.3%
log-rec85.3%
remove-double-neg85.3%
Simplified85.3%
Final simplification91.8%
(FPCore (x y z)
:precision binary64
(if (<= x 7500000000000.0)
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 7500000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
} else {
tmp = 0.91893853320467 + ((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 <= 7500000000000.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x
else
tmp = 0.91893853320467d0 + ((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 <= 7500000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
} else {
tmp = 0.91893853320467 + ((Math.log(x) * (x + -0.5)) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 7500000000000.0: tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x else: tmp = 0.91893853320467 + ((math.log(x) * (x + -0.5)) - x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 7500000000000.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x + -0.5)) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 7500000000000.0) tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x; else tmp = 0.91893853320467 + ((log(x) * (x + -0.5)) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 7500000000000.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7500000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
\end{array}
\end{array}
if x < 7.5e12Initial program 99.8%
clear-num99.7%
inv-pow99.7%
*-commutative99.7%
fma-udef99.7%
fma-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 97.1%
if 7.5e12 < x Initial program 82.0%
clear-num82.0%
inv-pow82.0%
*-commutative82.0%
fma-udef82.0%
fma-neg82.0%
metadata-eval82.0%
Applied egg-rr82.0%
Taylor expanded in x around inf 74.3%
sub-neg74.3%
mul-1-neg74.3%
log-rec74.3%
remove-double-neg74.3%
metadata-eval74.3%
distribute-rgt-in74.3%
*-commutative74.3%
neg-mul-174.3%
associate-+r+74.3%
Simplified74.3%
Final simplification86.3%
(FPCore (x y z)
:precision binary64
(if (<= x 6600000000000.0)
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6600000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 6600000000000.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 6600000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 6600000000000.0: tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 6600000000000.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 6600000000000.0) tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6600000000000.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6600000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 6.6e12Initial program 99.8%
clear-num99.7%
inv-pow99.7%
*-commutative99.7%
fma-udef99.7%
fma-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 97.1%
if 6.6e12 < x Initial program 82.0%
Taylor expanded in x around inf 74.2%
sub-neg74.2%
mul-1-neg74.2%
log-rec74.2%
remove-double-neg74.2%
metadata-eval74.2%
Simplified74.2%
Final simplification86.2%
(FPCore (x y z)
:precision binary64
(if (<= x 3000000000000.0)
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(- (* x (log x)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 3000000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
} else {
tmp = (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 (x <= 3000000000000.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x
else
tmp = (x * log(x)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3000000000000.0) {
tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
} else {
tmp = (x * Math.log(x)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3000000000000.0: tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x else: tmp = (x * math.log(x)) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3000000000000.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = Float64(Float64(x * log(x)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3000000000000.0) tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x; else tmp = (x * log(x)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3000000000000.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3000000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log x - x\\
\end{array}
\end{array}
if x < 3e12Initial program 99.8%
clear-num99.7%
inv-pow99.7%
*-commutative99.7%
fma-udef99.7%
fma-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 97.1%
if 3e12 < x Initial program 82.0%
Taylor expanded in x around inf 74.2%
sub-neg74.2%
mul-1-neg74.2%
log-rec74.2%
remove-double-neg74.2%
metadata-eval74.2%
Simplified74.2%
add-cube-cbrt73.3%
pow373.2%
Applied egg-rr73.2%
rem-cube-cbrt74.2%
distribute-rgt-in74.2%
neg-mul-174.2%
Applied egg-rr74.2%
Final simplification86.2%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 91.3%
clear-num91.3%
inv-pow91.3%
*-commutative91.3%
fma-udef91.3%
fma-neg91.3%
metadata-eval91.3%
Applied egg-rr91.3%
Taylor expanded in x around 0 61.5%
Final simplification61.5%
(FPCore (x y z) :precision binary64 (/ 1.0 (* (/ x z) -359.9999999999971)))
double code(double x, double y, double z) {
return 1.0 / ((x / z) * -359.9999999999971);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / ((x / z) * (-359.9999999999971d0))
end function
public static double code(double x, double y, double z) {
return 1.0 / ((x / z) * -359.9999999999971);
}
def code(x, y, z): return 1.0 / ((x / z) * -359.9999999999971)
function code(x, y, z) return Float64(1.0 / Float64(Float64(x / z) * -359.9999999999971)) end
function tmp = code(x, y, z) tmp = 1.0 / ((x / z) * -359.9999999999971); end
code[x_, y_, z_] := N[(1.0 / N[(N[(x / z), $MachinePrecision] * -359.9999999999971), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{x}{z} \cdot -359.9999999999971}
\end{array}
Initial program 91.3%
Taylor expanded in z around inf 35.5%
Taylor expanded in z around 0 9.4%
associate-*r/9.4%
Applied egg-rr9.4%
clear-num9.4%
inv-pow9.4%
*-commutative9.4%
Applied egg-rr9.4%
unpow-19.4%
*-rgt-identity9.4%
times-frac9.4%
metadata-eval9.4%
Simplified9.4%
Final simplification9.4%
(FPCore (x y z) :precision binary64 (* -0.0027777777777778 (/ z x)))
double code(double x, double y, double z) {
return -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.0027777777777778d0) * (z / x)
end function
public static double code(double x, double y, double z) {
return -0.0027777777777778 * (z / x);
}
def code(x, y, z): return -0.0027777777777778 * (z / x)
function code(x, y, z) return Float64(-0.0027777777777778 * Float64(z / x)) end
function tmp = code(x, y, z) tmp = -0.0027777777777778 * (z / x); end
code[x_, y_, z_] := N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.0027777777777778 \cdot \frac{z}{x}
\end{array}
Initial program 91.3%
Taylor expanded in z around inf 35.5%
Taylor expanded in z around 0 9.4%
Final simplification9.4%
(FPCore (x y z) :precision binary64 (/ -0.0027777777777778 (/ x z)))
double code(double x, double y, double z) {
return -0.0027777777777778 / (x / z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (-0.0027777777777778d0) / (x / z)
end function
public static double code(double x, double y, double z) {
return -0.0027777777777778 / (x / z);
}
def code(x, y, z): return -0.0027777777777778 / (x / z)
function code(x, y, z) return Float64(-0.0027777777777778 / Float64(x / z)) end
function tmp = code(x, y, z) tmp = -0.0027777777777778 / (x / z); end
code[x_, y_, z_] := N[(-0.0027777777777778 / N[(x / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-0.0027777777777778}{\frac{x}{z}}
\end{array}
Initial program 91.3%
Taylor expanded in z around inf 35.5%
Taylor expanded in z around 0 9.4%
associate-*r/9.4%
Applied egg-rr9.4%
*-un-lft-identity9.4%
associate-/l*9.4%
Applied egg-rr9.4%
Final simplification9.4%
(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 2024036
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))