
(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
(if (<= (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778)) 5e+230)
(+
(fma (+ x -0.5) (log x) (- x))
(+
0.91893853320467
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(pow (* z (sqrt (/ (+ y 0.0007936500793651) x))) 2.0))))
double code(double x, double y, double z) {
double tmp;
if ((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) <= 5e+230) {
tmp = fma((x + -0.5), log(x), -x) + (0.91893853320467 + (fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + pow((z * sqrt(((y + 0.0007936500793651) / x))), 2.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) <= 5e+230) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(-x)) + Float64(0.91893853320467 + Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + (Float64(z * sqrt(Float64(Float64(y + 0.0007936500793651) / x))) ^ 2.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 5e+230], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * N[Sqrt[N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq 5 \cdot 10^{+230}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, -x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + {\left(z \cdot \sqrt{\frac{y + 0.0007936500793651}{x}}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 5.0000000000000003e230Initial program 99.6%
associate-+l+99.6%
add099.6%
fma-neg99.6%
add099.6%
sub-neg99.6%
metadata-eval99.6%
fma-define99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
if 5.0000000000000003e230 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 83.7%
fma-neg83.7%
metadata-eval83.7%
fma-define83.7%
add-sqr-sqrt83.7%
pow283.7%
fma-define83.7%
*-commutative83.7%
fma-undefine83.7%
Applied egg-rr83.7%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778)) 5e+230)
(+
(fma (+ x -0.5) (log x) (- 0.91893853320467 x))
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(pow (* z (sqrt (/ (+ y 0.0007936500793651) x))) 2.0))))
double code(double x, double y, double z) {
double tmp;
if ((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) <= 5e+230) {
tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + pow((z * sqrt(((y + 0.0007936500793651) / x))), 2.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) <= 5e+230) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + (Float64(z * sqrt(Float64(Float64(y + 0.0007936500793651) / x))) ^ 2.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 5e+230], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * N[Sqrt[N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \leq 5 \cdot 10^{+230}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + {\left(z \cdot \sqrt{\frac{y + 0.0007936500793651}{x}}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 5.0000000000000003e230Initial program 99.6%
remove-double-neg99.6%
distribute-frac-neg299.6%
sub-neg99.6%
associate-+l+99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
unsub-neg99.6%
distribute-neg-frac299.6%
*-commutative99.6%
fma-define99.6%
fma-neg99.6%
metadata-eval99.6%
remove-double-neg99.6%
Simplified99.6%
if 5.0000000000000003e230 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 83.7%
fma-neg83.7%
metadata-eval83.7%
fma-define83.7%
add-sqr-sqrt83.7%
pow283.7%
fma-define83.7%
*-commutative83.7%
fma-undefine83.7%
Applied egg-rr83.7%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778)))
(t_1 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= t_0 5e+230)
(+ t_1 (/ (+ t_0 0.083333333333333) x))
(+ t_1 (pow (* z (sqrt (/ (+ y 0.0007936500793651) x))) 2.0)))))
double code(double x, double y, double z) {
double t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778);
double t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (t_0 <= 5e+230) {
tmp = t_1 + ((t_0 + 0.083333333333333) / x);
} else {
tmp = t_1 + pow((z * sqrt(((y + 0.0007936500793651) / x))), 2.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) :: t_1
real(8) :: tmp
t_0 = z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)
t_1 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (t_0 <= 5d+230) then
tmp = t_1 + ((t_0 + 0.083333333333333d0) / x)
else
tmp = t_1 + ((z * sqrt(((y + 0.0007936500793651d0) / x))) ** 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778);
double t_1 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (t_0 <= 5e+230) {
tmp = t_1 + ((t_0 + 0.083333333333333) / x);
} else {
tmp = t_1 + Math.pow((z * Math.sqrt(((y + 0.0007936500793651) / x))), 2.0);
}
return tmp;
}
def code(x, y, z): t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778) t_1 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if t_0 <= 5e+230: tmp = t_1 + ((t_0 + 0.083333333333333) / x) else: tmp = t_1 + math.pow((z * math.sqrt(((y + 0.0007936500793651) / x))), 2.0) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (t_0 <= 5e+230) tmp = Float64(t_1 + Float64(Float64(t_0 + 0.083333333333333) / x)); else tmp = Float64(t_1 + (Float64(z * sqrt(Float64(Float64(y + 0.0007936500793651) / x))) ^ 2.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (((y + 0.0007936500793651) * z) - 0.0027777777777778); t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (t_0 <= 5e+230) tmp = t_1 + ((t_0 + 0.083333333333333) / x); else tmp = t_1 + ((z * sqrt(((y + 0.0007936500793651) / x))) ^ 2.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+230], N[(t$95$1 + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[Power[N[(z * N[Sqrt[N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+230}:\\
\;\;\;\;t\_1 + \frac{t\_0 + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + {\left(z \cdot \sqrt{\frac{y + 0.0007936500793651}{x}}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 5.0000000000000003e230Initial program 99.6%
if 5.0000000000000003e230 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 83.7%
fma-neg83.7%
metadata-eval83.7%
fma-define83.7%
add-sqr-sqrt83.7%
pow283.7%
fma-define83.7%
*-commutative83.7%
fma-undefine83.7%
Applied egg-rr83.7%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 24500.0)
(-
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
x)
(if (<= x 2.3e+187)
(+
(* x (+ (log x) -1.0))
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x))
(+ (+ 0.91893853320467 (- (* x (log x)) x)) (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 24500.0) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else if (x <= 2.3e+187) {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((x * log(x)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 24500.0d0) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) - x
else if (x <= 2.3d+187) then
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((x * log(x)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 24500.0) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else if (x <= 2.3e+187) {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((x * Math.log(x)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 24500.0: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x elif x <= 2.3e+187: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((x * math.log(x)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 24500.0) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x); elseif (x <= 2.3e+187) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 24500.0) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x; elseif (x <= 2.3e+187) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((x * log(x)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 24500.0], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 2.3e+187], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 24500:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} - x\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+187}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 24500Initial program 99.7%
add-sqr-sqrt99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 98.3%
neg-mul-198.3%
Simplified98.3%
if 24500 < x < 2.30000000000000004e187Initial program 98.4%
Taylor expanded in x around inf 97.8%
sub-neg68.2%
mul-1-neg68.2%
log-rec68.2%
remove-double-neg68.2%
metadata-eval68.2%
Simplified97.8%
Taylor expanded in y around 0 81.7%
*-commutative14.9%
Simplified81.7%
if 2.30000000000000004e187 < x Initial program 81.5%
Taylor expanded in z around 0 84.0%
Taylor expanded in x around inf 84.0%
mul-1-neg84.0%
distribute-rgt-neg-in84.0%
log-rec84.0%
remove-double-neg84.0%
Simplified84.0%
Final simplification90.4%
(FPCore (x y z)
:precision binary64
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 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.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x);
}
def code(x, y, z): return (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}
\end{array}
Initial program 95.7%
Final simplification95.7%
(FPCore (x y z)
:precision binary64
(+
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 95.7%
Taylor expanded in x around inf 95.0%
sub-neg58.9%
mul-1-neg58.9%
log-rec58.9%
remove-double-neg58.9%
metadata-eval58.9%
Simplified95.0%
Final simplification95.0%
(FPCore (x y z)
:precision binary64
(if (<= x 4.9e+30)
(-
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
x)
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.9e+30) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - 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 <= 4.9d+30) then
tmp = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) - 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 <= 4.9e+30) {
tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x;
} else {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4.9e+30: tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x else: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4.9e+30) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - 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 <= 4.9e+30) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x; else tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4.9e+30], N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - x), $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 4.9 \cdot 10^{+30}:\\
\;\;\;\;\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 4.89999999999999984e30Initial program 99.7%
add-sqr-sqrt99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 93.7%
neg-mul-193.7%
Simplified93.7%
if 4.89999999999999984e30 < x Initial program 90.7%
Taylor expanded in z around 0 78.9%
Taylor expanded in x around inf 79.0%
sub-neg79.0%
mul-1-neg79.0%
log-rec79.0%
remove-double-neg79.0%
metadata-eval79.0%
Simplified79.0%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(if (or (<= y -9e+21) (not (<= y 1.1e-78)))
(- (/ (+ 0.083333333333333 (* z (- (* y z) 0.0027777777777778))) x) x)
(-
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)
x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9e+21) || !(y <= 1.1e-78)) {
tmp = ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x) - x;
} else {
tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-9d+21)) .or. (.not. (y <= 1.1d-78))) then
tmp = ((0.083333333333333d0 + (z * ((y * z) - 0.0027777777777778d0))) / x) - x
else
tmp = ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -9e+21) || !(y <= 1.1e-78)) {
tmp = ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x) - x;
} else {
tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9e+21) or not (y <= 1.1e-78): tmp = ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x) - x else: tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9e+21) || !(y <= 1.1e-78)) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(y * z) - 0.0027777777777778))) / x) - x); else tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9e+21) || ~((y <= 1.1e-78))) tmp = ((0.083333333333333 + (z * ((y * z) - 0.0027777777777778))) / x) - x; else tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9e+21], N[Not[LessEqual[y, 1.1e-78]], $MachinePrecision]], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(y * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+21} \lor \neg \left(y \leq 1.1 \cdot 10^{-78}\right):\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(y \cdot z - 0.0027777777777778\right)}{x} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x} - x\\
\end{array}
\end{array}
if y < -9e21 or 1.0999999999999999e-78 < y Initial program 97.3%
add-sqr-sqrt97.2%
pow297.2%
sub-neg97.2%
metadata-eval97.2%
*-commutative97.2%
Applied egg-rr97.2%
Taylor expanded in x around inf 64.9%
neg-mul-164.9%
Simplified64.9%
Taylor expanded in y around inf 64.9%
*-commutative64.9%
Simplified64.9%
if -9e21 < y < 1.0999999999999999e-78Initial program 93.5%
add-sqr-sqrt93.3%
pow293.3%
sub-neg93.3%
metadata-eval93.3%
*-commutative93.3%
Applied egg-rr93.3%
Taylor expanded in x around inf 58.3%
neg-mul-158.3%
Simplified58.3%
Taylor expanded in y around 0 58.3%
*-commutative58.3%
Simplified58.3%
Final simplification62.2%
(FPCore (x y z)
:precision binary64
(if (<= y -9e+21)
(- (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x) x)
(-
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x)
x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -9e+21) {
tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x;
} else {
tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-9d+21)) then
tmp = ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x) - x
else
tmp = ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9e+21) {
tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x;
} else {
tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9e+21: tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x else: tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9e+21) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x) - x); else tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9e+21) tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x; else tmp = ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9e+21], N[(N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+21}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x} - x\\
\end{array}
\end{array}
if y < -9e21Initial program 99.7%
add-sqr-sqrt99.5%
pow299.5%
sub-neg99.5%
metadata-eval99.5%
*-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 64.7%
neg-mul-164.7%
Simplified64.7%
Taylor expanded in z around 0 22.9%
*-commutative22.9%
Simplified22.9%
if -9e21 < y Initial program 94.3%
add-sqr-sqrt94.1%
pow294.1%
sub-neg94.1%
metadata-eval94.1%
*-commutative94.1%
Applied egg-rr94.1%
Taylor expanded in x around inf 61.3%
neg-mul-161.3%
Simplified61.3%
Taylor expanded in y around 0 55.4%
*-commutative55.4%
Simplified55.4%
Final simplification46.6%
(FPCore (x y z)
:precision binary64
(-
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x)
x))
double code(double x, double y, double z) {
return (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((z * (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) - x
end function
public static double code(double x, double y, double z) {
return (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x;
}
def code(x, y, z): return (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x
function code(x, y, z) return Float64(Float64(Float64(Float64(z * Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x) end
function tmp = code(x, y, z) tmp = (((z * (((y + 0.0007936500793651) * z) - 0.0027777777777778)) + 0.083333333333333) / x) - x; end
code[x_, y_, z_] := N[(N[(N[(N[(z * N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x} - x
\end{array}
Initial program 95.7%
add-sqr-sqrt95.6%
pow295.6%
sub-neg95.6%
metadata-eval95.6%
*-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in x around inf 62.2%
neg-mul-162.2%
Simplified62.2%
Final simplification62.2%
(FPCore (x y z) :precision binary64 (if (<= x 0.0068) (- (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x) x) (+ x (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.0068) {
tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x;
} else {
tmp = x + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.0068d0) then
tmp = ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x) - x
else
tmp = x + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.0068) {
tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x;
} else {
tmp = x + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.0068: tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x else: tmp = x + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.0068) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x) - x); else tmp = Float64(x + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.0068) tmp = ((0.083333333333333 + (z * -0.0027777777777778)) / x) - x; else tmp = x + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.0068], N[(N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], N[(x + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0068:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x} - x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 0.00679999999999999962Initial program 99.7%
add-sqr-sqrt99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 99.1%
neg-mul-199.1%
Simplified99.1%
Taylor expanded in z around 0 53.7%
*-commutative53.7%
Simplified53.7%
if 0.00679999999999999962 < x Initial program 92.0%
add-sqr-sqrt91.7%
pow291.7%
sub-neg91.7%
metadata-eval91.7%
*-commutative91.7%
Applied egg-rr91.7%
Taylor expanded in x around inf 27.1%
neg-mul-127.1%
Simplified27.1%
Taylor expanded in z around 0 1.1%
*-un-lft-identity1.1%
add-sqr-sqrt0.0%
sqrt-unprod12.7%
sqr-neg12.7%
sqrt-unprod11.4%
add-sqr-sqrt11.4%
Applied egg-rr11.4%
*-lft-identity11.4%
Simplified11.4%
Final simplification32.0%
(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 95.7%
add-sqr-sqrt95.6%
pow295.6%
sub-neg95.6%
metadata-eval95.6%
*-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in x around inf 62.2%
neg-mul-162.2%
Simplified62.2%
Taylor expanded in z around 0 21.9%
*-un-lft-identity21.9%
add-sqr-sqrt0.0%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod27.1%
add-sqr-sqrt27.1%
Applied egg-rr27.1%
*-lft-identity27.1%
Simplified27.1%
Final simplification27.1%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 95.7%
add-sqr-sqrt95.6%
pow295.6%
sub-neg95.6%
metadata-eval95.6%
*-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in x around inf 62.2%
neg-mul-162.2%
Simplified62.2%
Taylor expanded in z around 0 21.9%
Taylor expanded in x around 0 22.9%
Final simplification22.9%
(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 95.7%
add-sqr-sqrt95.6%
pow295.6%
sub-neg95.6%
metadata-eval95.6%
*-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in x around inf 62.2%
neg-mul-162.2%
Simplified62.2%
Taylor expanded in z around 0 21.9%
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 2024046
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))