
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<= x 12.5)
(+
t_0
(pow
(/
x
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333))
-1.0))
(+ t_0 (* (+ y 0.0007936500793651) (* (* z z) (/ 1.0 x)))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 12.5) {
tmp = t_0 + pow((x / fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333)), -1.0);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 12.5) tmp = Float64(t_0 + (Float64(x / fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333)) ^ -1.0)); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 12.5], N[(t$95$0 + N[Power[N[(x / N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 12.5:\\
\;\;\;\;t_0 + {\left(\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \left(\left(z \cdot z\right) \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 12.5Initial program 99.7%
clear-num99.7%
inv-pow99.7%
*-commutative99.7%
fma-udef99.7%
fma-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 12.5 < x Initial program 91.5%
Taylor expanded in z around inf 91.5%
associate-/l*96.3%
unpow296.3%
Simplified96.3%
associate-/r/96.3%
+-commutative96.3%
Applied egg-rr96.3%
div-inv96.4%
Applied egg-rr96.4%
Final simplification98.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<= x 6000000.0)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x))
(+ t_0 (* (+ y 0.0007936500793651) (* (* z z) (/ 1.0 x)))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 6000000.0) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if (x <= 6000000.0d0) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + ((y + 0.0007936500793651d0) * ((z * z) * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 6000000.0) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if x <= 6000000.0: tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) else: tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 6000000.0) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if (x <= 6000000.0) tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x); else tmp = t_0 + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 6000000.0], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 6000000:\\
\;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \left(\left(z \cdot z\right) \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 6e6Initial program 99.7%
if 6e6 < x Initial program 91.3%
Taylor expanded in z around inf 91.3%
associate-/l*96.2%
unpow296.2%
Simplified96.2%
associate-/r/96.3%
+-commutative96.3%
Applied egg-rr96.3%
div-inv96.3%
Applied egg-rr96.3%
Final simplification98.2%
(FPCore (x y z)
:precision binary64
(if (<= x 5300000.0)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0)))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(* (+ y 0.0007936500793651) (* (* z z) (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5300000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 5300000.0d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((y + 0.0007936500793651d0) * ((z * z) * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5300000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5300000.0: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0)) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5300000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5300000.0) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5300000.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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5300000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(y + 0.0007936500793651\right) \cdot \left(\left(z \cdot z\right) \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 5.3e6Initial program 99.7%
Taylor expanded in x around inf 99.2%
sub-neg37.8%
mul-1-neg37.8%
log-rec37.8%
remove-double-neg37.8%
metadata-eval37.8%
Simplified99.2%
if 5.3e6 < x Initial program 91.3%
Taylor expanded in z around inf 91.3%
associate-/l*96.2%
unpow296.2%
Simplified96.2%
associate-/r/96.3%
+-commutative96.3%
Applied egg-rr96.3%
div-inv96.3%
Applied egg-rr96.3%
Final simplification97.9%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5.2e-70) (not (<= z 5.5e-14)))
(+ (* (+ y 0.0007936500793651) (/ (* z z) x)) (- (* x (log x)) x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.2e-70) || !(z <= 5.5e-14)) {
tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * log(x)) - x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * -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 ((z <= (-5.2d-70)) .or. (.not. (z <= 5.5d-14))) then
tmp = ((y + 0.0007936500793651d0) * ((z * z) / x)) + ((x * log(x)) - x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.2e-70) || !(z <= 5.5e-14)) {
tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * Math.log(x)) - x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.2e-70) or not (z <= 5.5e-14): tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * math.log(x)) - x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * -0.0027777777777778)) / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.2e-70) || !(z <= 5.5e-14)) tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x)) + Float64(Float64(x * log(x)) - x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.2e-70) || ~((z <= 5.5e-14))) tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * log(x)) - x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (z * -0.0027777777777778)) / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.2e-70], N[Not[LessEqual[z, 5.5e-14]], $MachinePrecision]], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-70} \lor \neg \left(z \leq 5.5 \cdot 10^{-14}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} + \left(x \cdot \log x - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\
\end{array}
\end{array}
if z < -5.20000000000000004e-70 or 5.49999999999999991e-14 < z Initial program 93.4%
Taylor expanded in z around inf 93.1%
associate-/l*96.9%
unpow296.9%
Simplified96.9%
associate-/r/96.9%
+-commutative96.9%
Applied egg-rr96.9%
Taylor expanded in x around inf 96.9%
sub-neg96.9%
mul-1-neg96.9%
log-rec96.9%
remove-double-neg96.9%
metadata-eval96.9%
distribute-rgt-in96.9%
neg-mul-196.9%
sub-neg96.9%
*-commutative96.9%
Simplified96.9%
if -5.20000000000000004e-70 < z < 5.49999999999999991e-14Initial program 99.4%
Taylor expanded in z around 0 96.0%
*-commutative96.0%
Simplified96.0%
Final simplification96.5%
(FPCore (x y z)
:precision binary64
(if (<= x 10000000.0)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0)))
(+ (* (+ y 0.0007936500793651) (/ (* z z) x)) (- (* x (log x)) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 10000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
} else {
tmp = ((y + 0.0007936500793651) * ((z * z) / 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 <= 10000000.0d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = ((y + 0.0007936500793651d0) * ((z * z) / 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 <= 10000000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * Math.log(x)) - x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 10000000.0: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0)) else: tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * math.log(x)) - x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 10000000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x)) + Float64(Float64(x * log(x)) - x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 10000000.0) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); else tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * log(x)) - x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 10000000.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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} + \left(x \cdot \log x - x\right)\\
\end{array}
\end{array}
if x < 1e7Initial program 99.7%
Taylor expanded in x around inf 99.2%
sub-neg37.8%
mul-1-neg37.8%
log-rec37.8%
remove-double-neg37.8%
metadata-eval37.8%
Simplified99.2%
if 1e7 < x Initial program 91.3%
Taylor expanded in z around inf 91.3%
associate-/l*96.2%
unpow296.2%
Simplified96.2%
associate-/r/96.3%
+-commutative96.3%
Applied egg-rr96.3%
Taylor expanded in x around inf 95.9%
sub-neg95.9%
mul-1-neg95.9%
log-rec95.9%
remove-double-neg95.9%
metadata-eval95.9%
distribute-rgt-in95.9%
neg-mul-195.9%
sub-neg95.9%
*-commutative95.9%
Simplified95.9%
Final simplification97.7%
(FPCore (x y z)
:precision binary64
(if (<= x 5300000.0)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0)))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(* (+ y 0.0007936500793651) (/ (* z z) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5300000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) / 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 <= 5300000.0d0) then
tmp = ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((y + 0.0007936500793651d0) * ((z * z) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5300000.0) {
tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5300000.0: tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (math.log(x) + -1.0)) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5300000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5300000.0) tmp = ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x) + (x * (log(x) + -1.0)); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((y + 0.0007936500793651) * ((z * z) / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5300000.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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5300000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\
\end{array}
\end{array}
if x < 5.3e6Initial program 99.7%
Taylor expanded in x around inf 99.2%
sub-neg37.8%
mul-1-neg37.8%
log-rec37.8%
remove-double-neg37.8%
metadata-eval37.8%
Simplified99.2%
if 5.3e6 < x Initial program 91.3%
Taylor expanded in z around inf 91.3%
associate-/l*96.2%
unpow296.2%
Simplified96.2%
associate-/r/96.3%
+-commutative96.3%
Applied egg-rr96.3%
Final simplification97.9%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5.3e-70) (not (<= z 1.95e-13)))
(+ (* (+ y 0.0007936500793651) (/ (* z z) x)) (- (* x (log x)) x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.3e-70) || !(z <= 1.95e-13)) {
tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * log(x)) - x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (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 ((z <= (-5.3d-70)) .or. (.not. (z <= 1.95d-13))) then
tmp = ((y + 0.0007936500793651d0) * ((z * z) / x)) + ((x * log(x)) - x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.3e-70) || !(z <= 1.95e-13)) {
tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * Math.log(x)) - x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.3e-70) or not (z <= 1.95e-13): tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * math.log(x)) - x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.3e-70) || !(z <= 1.95e-13)) tmp = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / x)) + Float64(Float64(x * log(x)) - x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.3e-70) || ~((z <= 1.95e-13))) tmp = ((y + 0.0007936500793651) * ((z * z) / x)) + ((x * log(x)) - x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.3e-70], N[Not[LessEqual[z, 1.95e-13]], $MachinePrecision]], N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-70} \lor \neg \left(z \leq 1.95 \cdot 10^{-13}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x} + \left(x \cdot \log x - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -5.29999999999999983e-70 or 1.95000000000000002e-13 < z Initial program 93.4%
Taylor expanded in z around inf 93.1%
associate-/l*96.9%
unpow296.9%
Simplified96.9%
associate-/r/96.9%
+-commutative96.9%
Applied egg-rr96.9%
Taylor expanded in x around inf 96.9%
sub-neg96.9%
mul-1-neg96.9%
log-rec96.9%
remove-double-neg96.9%
metadata-eval96.9%
distribute-rgt-in96.9%
neg-mul-196.9%
sub-neg96.9%
*-commutative96.9%
Simplified96.9%
if -5.29999999999999983e-70 < z < 1.95000000000000002e-13Initial program 99.4%
Taylor expanded in z around 0 95.9%
Final simplification96.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (or (<= z -1.5e-70) (not (<= z 1.35e-11)))
(+ t_0 (/ y (/ x (* z z))))
(+ t_0 (/ 1.0 (* x 12.000000000000048))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if ((z <= -1.5e-70) || !(z <= 1.35e-11)) {
tmp = t_0 + (y / (x / (z * z)));
} else {
tmp = t_0 + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if ((z <= (-1.5d-70)) .or. (.not. (z <= 1.35d-11))) then
tmp = t_0 + (y / (x / (z * z)))
else
tmp = t_0 + (1.0d0 / (x * 12.000000000000048d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if ((z <= -1.5e-70) || !(z <= 1.35e-11)) {
tmp = t_0 + (y / (x / (z * z)));
} else {
tmp = t_0 + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if (z <= -1.5e-70) or not (z <= 1.35e-11): tmp = t_0 + (y / (x / (z * z))) else: tmp = t_0 + (1.0 / (x * 12.000000000000048)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if ((z <= -1.5e-70) || !(z <= 1.35e-11)) tmp = Float64(t_0 + Float64(y / Float64(x / Float64(z * z)))); else tmp = Float64(t_0 + Float64(1.0 / Float64(x * 12.000000000000048))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if ((z <= -1.5e-70) || ~((z <= 1.35e-11))) tmp = t_0 + (y / (x / (z * z))); else tmp = t_0 + (1.0 / (x * 12.000000000000048)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -1.5e-70], N[Not[LessEqual[z, 1.35e-11]], $MachinePrecision]], N[(t$95$0 + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-70} \lor \neg \left(z \leq 1.35 \cdot 10^{-11}\right):\\
\;\;\;\;t_0 + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -1.5000000000000001e-70 or 1.35000000000000002e-11 < z Initial program 93.4%
Taylor expanded in x around inf 93.5%
sub-neg24.0%
mul-1-neg24.0%
log-rec24.0%
remove-double-neg24.0%
metadata-eval24.0%
Simplified93.5%
Taylor expanded in y around inf 71.6%
associate-/l*77.4%
unpow277.4%
Simplified77.4%
if -1.5000000000000001e-70 < z < 1.35000000000000002e-11Initial program 99.4%
Taylor expanded in z around 0 95.9%
Taylor expanded in x around inf 94.9%
sub-neg94.9%
mul-1-neg94.9%
log-rec94.9%
remove-double-neg94.9%
metadata-eval94.9%
Simplified94.9%
add-sqr-sqrt94.8%
Applied egg-rr94.8%
add-sqr-sqrt94.9%
clear-num94.9%
div-inv95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Final simplification84.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -5.3e-70) (not (<= z 3.2e-14)))
(+ (* x (+ (log x) -1.0)) (/ y (/ x (* z z))))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.3e-70) || !(z <= 3.2e-14)) {
tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (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 ((z <= (-5.3d-70)) .or. (.not. (z <= 3.2d-14))) then
tmp = (x * (log(x) + (-1.0d0))) + (y / (x / (z * z)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.3e-70) || !(z <= 3.2e-14)) {
tmp = (x * (Math.log(x) + -1.0)) + (y / (x / (z * z)));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.3e-70) or not (z <= 3.2e-14): tmp = (x * (math.log(x) + -1.0)) + (y / (x / (z * z))) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.3e-70) || !(z <= 3.2e-14)) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(y / Float64(x / Float64(z * z)))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.3e-70) || ~((z <= 3.2e-14))) tmp = (x * (log(x) + -1.0)) + (y / (x / (z * z))); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.3e-70], N[Not[LessEqual[z, 3.2e-14]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-70} \lor \neg \left(z \leq 3.2 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -5.29999999999999983e-70 or 3.2000000000000002e-14 < z Initial program 93.4%
Taylor expanded in x around inf 93.5%
sub-neg24.0%
mul-1-neg24.0%
log-rec24.0%
remove-double-neg24.0%
metadata-eval24.0%
Simplified93.5%
Taylor expanded in y around inf 71.6%
associate-/l*77.4%
unpow277.4%
Simplified77.4%
if -5.29999999999999983e-70 < z < 3.2000000000000002e-14Initial program 99.4%
Taylor expanded in z around 0 95.9%
Final simplification85.2%
(FPCore (x y z)
:precision binary64
(if (<= x 5300000.0)
(/
(- (/ 0.0069444444444443885 (* x x)) (* x x))
(+ x (/ 0.083333333333333 x)))
(+ (* x (+ (log x) -1.0)) (/ -0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5300000.0) {
tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / (x + (0.083333333333333 / x));
} else {
tmp = (x * (log(x) + -1.0)) + (-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 <= 5300000.0d0) then
tmp = ((0.0069444444444443885d0 / (x * x)) - (x * x)) / (x + (0.083333333333333d0 / x))
else
tmp = (x * (log(x) + (-1.0d0))) + ((-0.083333333333333d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5300000.0) {
tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / (x + (0.083333333333333 / x));
} else {
tmp = (x * (Math.log(x) + -1.0)) + (-0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5300000.0: tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / (x + (0.083333333333333 / x)) else: tmp = (x * (math.log(x) + -1.0)) + (-0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5300000.0) tmp = Float64(Float64(Float64(0.0069444444444443885 / Float64(x * x)) - Float64(x * x)) / Float64(x + Float64(0.083333333333333 / x))); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(-0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5300000.0) tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / (x + (0.083333333333333 / x)); else tmp = (x * (log(x) + -1.0)) + (-0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5300000.0], N[(N[(N[(0.0069444444444443885 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(-0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5300000:\\
\;\;\;\;\frac{\frac{0.0069444444444443885}{x \cdot x} - x \cdot x}{x + \frac{0.083333333333333}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{-0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 5.3e6Initial program 99.7%
Taylor expanded in z around 0 38.3%
add-cube-cbrt38.3%
pow338.3%
sub-neg38.3%
metadata-eval38.3%
Applied egg-rr38.3%
Taylor expanded in x around inf 37.9%
neg-mul-137.9%
Simplified37.9%
+-commutative37.9%
flip-+49.1%
frac-times49.2%
metadata-eval49.2%
sqr-neg49.2%
add-sqr-sqrt0.0%
sqrt-unprod49.1%
sqr-neg49.1%
sqrt-unprod49.1%
add-sqr-sqrt49.1%
unsub-neg49.1%
+-commutative49.1%
add-sqr-sqrt0.0%
sqrt-unprod49.2%
sqr-neg49.2%
sqrt-unprod49.2%
add-sqr-sqrt49.2%
Applied egg-rr49.2%
if 5.3e6 < x Initial program 91.3%
Taylor expanded in z around 0 74.2%
Taylor expanded in x around inf 73.9%
sub-neg73.9%
mul-1-neg73.9%
log-rec73.9%
remove-double-neg73.9%
metadata-eval73.9%
Simplified73.9%
add-sqr-sqrt73.9%
Applied egg-rr73.9%
add-sqr-sqrt73.9%
frac-2neg73.9%
metadata-eval73.9%
add-sqr-sqrt0.0%
sqrt-unprod73.9%
sqr-neg73.9%
sqrt-unprod73.9%
add-sqr-sqrt73.9%
Applied egg-rr73.9%
Final simplification60.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (/ 0.083333333333333 x))))
(if (or (<= z -3.1e+16) (not (<= z 1.05e-8)))
(/ (- (/ 0.0069444444444443885 (* x x)) (* x x)) t_0)
t_0)))
double code(double x, double y, double z) {
double t_0 = x + (0.083333333333333 / x);
double tmp;
if ((z <= -3.1e+16) || !(z <= 1.05e-8)) {
tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / t_0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x + (0.083333333333333d0 / x)
if ((z <= (-3.1d+16)) .or. (.not. (z <= 1.05d-8))) then
tmp = ((0.0069444444444443885d0 / (x * x)) - (x * x)) / t_0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (0.083333333333333 / x);
double tmp;
if ((z <= -3.1e+16) || !(z <= 1.05e-8)) {
tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / t_0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (0.083333333333333 / x) tmp = 0 if (z <= -3.1e+16) or not (z <= 1.05e-8): tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / t_0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(0.083333333333333 / x)) tmp = 0.0 if ((z <= -3.1e+16) || !(z <= 1.05e-8)) tmp = Float64(Float64(Float64(0.0069444444444443885 / Float64(x * x)) - Float64(x * x)) / t_0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (0.083333333333333 / x); tmp = 0.0; if ((z <= -3.1e+16) || ~((z <= 1.05e-8))) tmp = ((0.0069444444444443885 / (x * x)) - (x * x)) / t_0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -3.1e+16], N[Not[LessEqual[z, 1.05e-8]], $MachinePrecision]], N[(N[(N[(0.0069444444444443885 / N[(x * x), $MachinePrecision]), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{0.083333333333333}{x}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+16} \lor \neg \left(z \leq 1.05 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{\frac{0.0069444444444443885}{x \cdot x} - x \cdot x}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.1e16 or 1.04999999999999997e-8 < z Initial program 92.9%
Taylor expanded in z around 0 21.5%
add-cube-cbrt21.4%
pow321.3%
sub-neg21.3%
metadata-eval21.3%
Applied egg-rr21.3%
Taylor expanded in x around inf 3.0%
neg-mul-13.0%
Simplified3.0%
+-commutative3.0%
flip-+29.1%
frac-times29.1%
metadata-eval29.1%
sqr-neg29.1%
add-sqr-sqrt0.0%
sqrt-unprod27.1%
sqr-neg27.1%
sqrt-unprod32.4%
add-sqr-sqrt32.4%
unsub-neg32.4%
+-commutative32.4%
add-sqr-sqrt0.0%
sqrt-unprod26.2%
sqr-neg26.2%
sqrt-unprod29.1%
add-sqr-sqrt29.1%
Applied egg-rr29.1%
if -3.1e16 < z < 1.04999999999999997e-8Initial program 99.5%
Taylor expanded in z around 0 91.5%
add-cube-cbrt90.6%
pow390.6%
sub-neg90.6%
metadata-eval90.6%
Applied egg-rr90.6%
Taylor expanded in x around inf 42.3%
neg-mul-142.3%
Simplified42.3%
expm1-log1p-u38.7%
expm1-udef38.6%
add-sqr-sqrt0.0%
sqrt-unprod43.7%
sqr-neg43.7%
sqrt-unprod45.6%
add-sqr-sqrt45.6%
Applied egg-rr45.6%
expm1-def45.6%
expm1-log1p48.8%
Simplified48.8%
Final simplification38.4%
(FPCore (x y z) :precision binary64 (+ x (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
return x + (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.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
return x + (0.083333333333333 / x);
}
def code(x, y, z): return x + (0.083333333333333 / x)
function code(x, y, z) return Float64(x + Float64(0.083333333333333 / x)) end
function tmp = code(x, y, z) tmp = x + (0.083333333333333 / x); end
code[x_, y_, z_] := N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.083333333333333}{x}
\end{array}
Initial program 96.0%
Taylor expanded in z around 0 54.3%
add-cube-cbrt53.8%
pow353.8%
sub-neg53.8%
metadata-eval53.8%
Applied egg-rr53.8%
Taylor expanded in x around inf 21.4%
neg-mul-121.4%
Simplified21.4%
expm1-log1p-u19.4%
expm1-udef19.4%
add-sqr-sqrt0.0%
sqrt-unprod25.3%
sqr-neg25.3%
sqrt-unprod24.5%
add-sqr-sqrt24.5%
Applied egg-rr24.5%
expm1-def24.5%
expm1-log1p26.0%
Simplified26.0%
Final simplification26.0%
(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.0%
Taylor expanded in z around 0 54.3%
add-cube-cbrt53.8%
pow353.8%
sub-neg53.8%
metadata-eval53.8%
Applied egg-rr53.8%
Taylor expanded in x around inf 21.4%
neg-mul-121.4%
Simplified21.4%
Taylor expanded in x around 0 22.3%
Final simplification22.3%
(FPCore (x y z) :precision binary64 (- x))
double code(double x, double y, double z) {
return -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
end function
public static double code(double x, double y, double z) {
return -x;
}
def code(x, y, z): return -x
function code(x, y, z) return Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 96.0%
Taylor expanded in z around 0 54.3%
add-cube-cbrt53.8%
pow353.8%
sub-neg53.8%
metadata-eval53.8%
Applied egg-rr53.8%
Taylor expanded in x around inf 21.4%
neg-mul-121.4%
Simplified21.4%
Taylor expanded in x around inf 1.3%
mul-1-neg1.3%
Simplified1.3%
Final simplification1.3%
(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 2023277
(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)))