
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- 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}
Initial program 95.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z))
(t_1
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ (+ t_0 0.083333333333333) x))))
(if (<= t_1 -1e+190)
t_0
(if (<= t_1 5e+305) (+ (- x 0.5) 0.91893853320467) t_0))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double t_1 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((t_0 + 0.083333333333333) / x);
double tmp;
if (t_1 <= -1e+190) {
tmp = t_0;
} else if (t_1 <= 5e+305) {
tmp = (x - 0.5) + 0.91893853320467;
} 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) :: t_1
real(8) :: tmp
t_0 = (((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z
t_1 = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((t_0 + 0.083333333333333d0) / x)
if (t_1 <= (-1d+190)) then
tmp = t_0
else if (t_1 <= 5d+305) then
tmp = (x - 0.5d0) + 0.91893853320467d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double t_1 = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((t_0 + 0.083333333333333) / x);
double tmp;
if (t_1 <= -1e+190) {
tmp = t_0;
} else if (t_1 <= 5e+305) {
tmp = (x - 0.5) + 0.91893853320467;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z t_1 = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((t_0 + 0.083333333333333) / x) tmp = 0 if t_1 <= -1e+190: tmp = t_0 elif t_1 <= 5e+305: tmp = (x - 0.5) + 0.91893853320467 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) t_1 = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(t_0 + 0.083333333333333) / x)) tmp = 0.0 if (t_1 <= -1e+190) tmp = t_0; elseif (t_1 <= 5e+305) tmp = Float64(Float64(x - 0.5) + 0.91893853320467); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z; t_1 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((t_0 + 0.083333333333333) / x); tmp = 0.0; if (t_1 <= -1e+190) tmp = t_0; elseif (t_1 <= 5e+305) tmp = (x - 0.5) + 0.91893853320467; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+190], t$95$0, If[LessEqual[t$95$1, 5e+305], N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
t_1 := \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{t\_0 + 0.083333333333333}{x}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+190}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -1.0000000000000001e190 or 5.00000000000000009e305 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 88.6%
Taylor expanded in x around 0
Applied rewrites8.7%
Taylor expanded in x around inf
Applied rewrites65.7%
if -1.0000000000000001e190 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 5.00000000000000009e305Initial program 99.4%
Taylor expanded in x around 0
Applied rewrites51.8%
Taylor expanded in x around 0
Applied rewrites9.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- x 0.5) (log x))))
(if (<= x 1.4e+97)
(+
(+
t_0
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
0.91893853320467)
(- t_0 x))))
double code(double x, double y, double z) {
double t_0 = (x - 0.5) * log(x);
double tmp;
if (x <= 1.4e+97) {
tmp = (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) + 0.91893853320467;
} else {
tmp = t_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)
if (x <= 1.4d+97) then
tmp = (t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)) + 0.91893853320467d0
else
tmp = t_0 - 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);
double tmp;
if (x <= 1.4e+97) {
tmp = (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) + 0.91893853320467;
} else {
tmp = t_0 - x;
}
return tmp;
}
def code(x, y, z): t_0 = (x - 0.5) * math.log(x) tmp = 0 if x <= 1.4e+97: tmp = (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) + 0.91893853320467 else: tmp = t_0 - x return tmp
function code(x, y, z) t_0 = Float64(Float64(x - 0.5) * log(x)) tmp = 0.0 if (x <= 1.4e+97) tmp = Float64(Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) + 0.91893853320467); else tmp = Float64(t_0 - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - 0.5) * log(x); tmp = 0.0; if (x <= 1.4e+97) tmp = (t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) + 0.91893853320467; else tmp = t_0 - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.4e+97], N[(N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(t$95$0 - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x - 0.5\right) \cdot \log x\\
\mathbf{if}\;x \leq 1.4 \cdot 10^{+97}:\\
\;\;\;\;\left(t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\right) + 0.91893853320467\\
\mathbf{else}:\\
\;\;\;\;t\_0 - x\\
\end{array}
\end{array}
if x < 1.4e97Initial program 98.6%
Taylor expanded in x around 0
Applied rewrites15.8%
Taylor expanded in x around 0
Applied rewrites88.8%
if 1.4e97 < x Initial program 87.8%
Taylor expanded in x around 0
Applied rewrites79.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- x 0.5) (log x))))
(if (<= x 1.4e+97)
(+
t_0
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(- t_0 x))))
double code(double x, double y, double z) {
double t_0 = (x - 0.5) * log(x);
double tmp;
if (x <= 1.4e+97) {
tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = t_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)
if (x <= 1.4d+97) then
tmp = t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = t_0 - 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);
double tmp;
if (x <= 1.4e+97) {
tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = t_0 - x;
}
return tmp;
}
def code(x, y, z): t_0 = (x - 0.5) * math.log(x) tmp = 0 if x <= 1.4e+97: tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = t_0 - x return tmp
function code(x, y, z) t_0 = Float64(Float64(x - 0.5) * log(x)) tmp = 0.0 if (x <= 1.4e+97) tmp = Float64(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(t_0 - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x - 0.5) * log(x); tmp = 0.0; if (x <= 1.4e+97) tmp = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = t_0 - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.4e+97], N[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x - 0.5\right) \cdot \log x\\
\mathbf{if}\;x \leq 1.4 \cdot 10^{+97}:\\
\;\;\;\;t\_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 - x\\
\end{array}
\end{array}
if x < 1.4e97Initial program 98.6%
Taylor expanded in x around 0
Applied rewrites88.5%
if 1.4e97 < x Initial program 87.8%
Taylor expanded in x around 0
Applied rewrites79.1%
(FPCore (x y z)
:precision binary64
(if (<= x 1.4e+97)
(+
(+ (- x 0.5) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(- (* (- x 0.5) (log x)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.4e+97) {
tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((x - 0.5) * 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 <= 1.4d+97) then
tmp = ((x - 0.5d0) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = ((x - 0.5d0) * log(x)) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 1.4e+97) {
tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = ((x - 0.5) * Math.log(x)) - x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.4e+97: tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = ((x - 0.5) * math.log(x)) - x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.4e+97) tmp = Float64(Float64(Float64(x - 0.5) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(Float64(Float64(x - 0.5) * log(x)) - x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.4e+97) tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = ((x - 0.5) * log(x)) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.4e+97], N[(N[(N[(x - 0.5), $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], N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{+97}:\\
\;\;\;\;\left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(x - 0.5\right) \cdot \log x - x\\
\end{array}
\end{array}
if x < 1.4e97Initial program 98.6%
Taylor expanded in x around 0
Applied rewrites88.5%
Taylor expanded in x around 0
Applied rewrites16.5%
Taylor expanded in x around 0
Applied rewrites77.4%
Taylor expanded in x around 0
Applied rewrites86.8%
if 1.4e97 < x Initial program 87.8%
Taylor expanded in x around 0
Applied rewrites79.1%
(FPCore (x y z)
:precision binary64
(if (<= x 5.5e+226)
(+
(+ (- x 0.5) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x))
(* (- x 0.5) (log x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.5e+226) {
tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = (x - 0.5) * log(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 <= 5.5d+226) then
tmp = ((x - 0.5d0) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
else
tmp = (x - 0.5d0) * log(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5.5e+226) {
tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
} else {
tmp = (x - 0.5) * Math.log(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.5e+226: tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) else: tmp = (x - 0.5) * math.log(x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.5e+226) tmp = Float64(Float64(Float64(x - 0.5) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)); else tmp = Float64(Float64(x - 0.5) * log(x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5.5e+226) tmp = ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); else tmp = (x - 0.5) * log(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.5e+226], N[(N[(N[(x - 0.5), $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], N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.5 \cdot 10^{+226}:\\
\;\;\;\;\left(\left(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(x - 0.5\right) \cdot \log x\\
\end{array}
\end{array}
if x < 5.5000000000000005e226Initial program 97.5%
Taylor expanded in x around 0
Applied rewrites80.3%
Taylor expanded in x around 0
Applied rewrites18.1%
Taylor expanded in x around 0
Applied rewrites68.2%
Taylor expanded in x around 0
Applied rewrites76.7%
if 5.5000000000000005e226 < x Initial program 81.9%
Taylor expanded in x around 0
Applied rewrites89.5%
Taylor expanded in x around 0
Applied rewrites31.8%
(FPCore (x y z)
:precision binary64
(+
(+ (- x 0.5) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((x - 0.5) + 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) + 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) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((x - 0.5) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(x - 0.5) + 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) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(x - 0.5), $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(x - 0.5\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Initial program 95.2%
Taylor expanded in x around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites17.0%
Taylor expanded in x around 0
Applied rewrites60.3%
Taylor expanded in x around 0
Applied rewrites68.1%
(FPCore (x y z)
:precision binary64
(+
(- x 0.5)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return (x - 0.5) + ((((((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) + ((((((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) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return (x - 0.5) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(x - 0.5) + 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) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(x - 0.5), $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(x - 0.5\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Initial program 95.2%
Taylor expanded in x around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites17.0%
Taylor expanded in x around 0
Applied rewrites60.3%
Taylor expanded in x around 0
Applied rewrites68.1%
(FPCore (x y z) :precision binary64 (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x))
double code(double x, double y, double z) {
return (((((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 = (((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x
end function
public static double code(double x, double y, double z) {
return (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x;
}
def code(x, y, z): return (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) end
function tmp = code(x, y, z) tmp = (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
Initial program 95.2%
Taylor expanded in x around 0
Applied rewrites73.5%
Taylor expanded in x around 0
Applied rewrites17.0%
Taylor expanded in x around 0
Applied rewrites60.3%
Taylor expanded in x around -inf
Applied rewrites64.8%
(FPCore (x y z)
:precision binary64
(if (<= z -1.55e+110)
(* (- x 0.5) (+ y 0.0007936500793651))
(if (<= z 6.4e+44)
(+ (- x 0.5) 0.91893853320467)
(+
(+ (* (+ y 0.0007936500793651) z) 0.91893853320467)
0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+110) {
tmp = (x - 0.5) * (y + 0.0007936500793651);
} else if (z <= 6.4e+44) {
tmp = (x - 0.5) + 0.91893853320467;
} else {
tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.55d+110)) then
tmp = (x - 0.5d0) * (y + 0.0007936500793651d0)
else if (z <= 6.4d+44) then
tmp = (x - 0.5d0) + 0.91893853320467d0
else
tmp = (((y + 0.0007936500793651d0) * z) + 0.91893853320467d0) + 0.91893853320467d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+110) {
tmp = (x - 0.5) * (y + 0.0007936500793651);
} else if (z <= 6.4e+44) {
tmp = (x - 0.5) + 0.91893853320467;
} else {
tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.55e+110: tmp = (x - 0.5) * (y + 0.0007936500793651) elif z <= 6.4e+44: tmp = (x - 0.5) + 0.91893853320467 else: tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.55e+110) tmp = Float64(Float64(x - 0.5) * Float64(y + 0.0007936500793651)); elseif (z <= 6.4e+44) tmp = Float64(Float64(x - 0.5) + 0.91893853320467); else tmp = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.55e+110) tmp = (x - 0.5) * (y + 0.0007936500793651); elseif (z <= 6.4e+44) tmp = (x - 0.5) + 0.91893853320467; else tmp = (((y + 0.0007936500793651) * z) + 0.91893853320467) + 0.91893853320467; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.55e+110], N[(N[(x - 0.5), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e+44], N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + 0.91893853320467), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+110}:\\
\;\;\;\;\left(x - 0.5\right) \cdot \left(y + 0.0007936500793651\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+44}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y + 0.0007936500793651\right) \cdot z + 0.91893853320467\right) + 0.91893853320467\\
\end{array}
\end{array}
if z < -1.55000000000000009e110Initial program 91.7%
Taylor expanded in x around 0
Applied rewrites88.8%
Taylor expanded in x around 0
Applied rewrites28.7%
Taylor expanded in x around 0
Applied rewrites87.9%
Taylor expanded in x around 0
Applied rewrites16.2%
if -1.55000000000000009e110 < z < 6.40000000000000009e44Initial program 99.4%
Taylor expanded in x around 0
Applied rewrites49.3%
Taylor expanded in x around 0
Applied rewrites9.1%
if 6.40000000000000009e44 < z Initial program 87.1%
Taylor expanded in x around 0
Applied rewrites18.3%
Taylor expanded in x around 0
Applied rewrites5.0%
Taylor expanded in x around 0
Applied rewrites30.7%
(FPCore (x y z)
:precision binary64
(if (<= z -1.55e+110)
(* (- x 0.5) (+ y 0.0007936500793651))
(if (<= z 6.4e+44)
(+ (- x 0.5) 0.91893853320467)
(* (+ y 0.0007936500793651) z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+110) {
tmp = (x - 0.5) * (y + 0.0007936500793651);
} else if (z <= 6.4e+44) {
tmp = (x - 0.5) + 0.91893853320467;
} else {
tmp = (y + 0.0007936500793651) * z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.55d+110)) then
tmp = (x - 0.5d0) * (y + 0.0007936500793651d0)
else if (z <= 6.4d+44) then
tmp = (x - 0.5d0) + 0.91893853320467d0
else
tmp = (y + 0.0007936500793651d0) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e+110) {
tmp = (x - 0.5) * (y + 0.0007936500793651);
} else if (z <= 6.4e+44) {
tmp = (x - 0.5) + 0.91893853320467;
} else {
tmp = (y + 0.0007936500793651) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.55e+110: tmp = (x - 0.5) * (y + 0.0007936500793651) elif z <= 6.4e+44: tmp = (x - 0.5) + 0.91893853320467 else: tmp = (y + 0.0007936500793651) * z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.55e+110) tmp = Float64(Float64(x - 0.5) * Float64(y + 0.0007936500793651)); elseif (z <= 6.4e+44) tmp = Float64(Float64(x - 0.5) + 0.91893853320467); else tmp = Float64(Float64(y + 0.0007936500793651) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.55e+110) tmp = (x - 0.5) * (y + 0.0007936500793651); elseif (z <= 6.4e+44) tmp = (x - 0.5) + 0.91893853320467; else tmp = (y + 0.0007936500793651) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.55e+110], N[(N[(x - 0.5), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e+44], N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+110}:\\
\;\;\;\;\left(x - 0.5\right) \cdot \left(y + 0.0007936500793651\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+44}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot z\\
\end{array}
\end{array}
if z < -1.55000000000000009e110Initial program 91.7%
Taylor expanded in x around 0
Applied rewrites88.8%
Taylor expanded in x around 0
Applied rewrites28.7%
Taylor expanded in x around 0
Applied rewrites87.9%
Taylor expanded in x around 0
Applied rewrites16.2%
if -1.55000000000000009e110 < z < 6.40000000000000009e44Initial program 99.4%
Taylor expanded in x around 0
Applied rewrites49.3%
Taylor expanded in x around 0
Applied rewrites9.1%
if 6.40000000000000009e44 < z Initial program 87.1%
Taylor expanded in x around 0
Applied rewrites18.3%
Taylor expanded in x around inf
Applied rewrites30.7%
(FPCore (x y z) :precision binary64 (if (<= z 6.4e+44) (+ (- x 0.5) 0.91893853320467) (* (+ y 0.0007936500793651) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= 6.4e+44) {
tmp = (x - 0.5) + 0.91893853320467;
} else {
tmp = (y + 0.0007936500793651) * z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= 6.4d+44) then
tmp = (x - 0.5d0) + 0.91893853320467d0
else
tmp = (y + 0.0007936500793651d0) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 6.4e+44) {
tmp = (x - 0.5) + 0.91893853320467;
} else {
tmp = (y + 0.0007936500793651) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 6.4e+44: tmp = (x - 0.5) + 0.91893853320467 else: tmp = (y + 0.0007936500793651) * z return tmp
function code(x, y, z) tmp = 0.0 if (z <= 6.4e+44) tmp = Float64(Float64(x - 0.5) + 0.91893853320467); else tmp = Float64(Float64(y + 0.0007936500793651) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 6.4e+44) tmp = (x - 0.5) + 0.91893853320467; else tmp = (y + 0.0007936500793651) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 6.4e+44], N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.4 \cdot 10^{+44}:\\
\;\;\;\;\left(x - 0.5\right) + 0.91893853320467\\
\mathbf{else}:\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot z\\
\end{array}
\end{array}
if z < 6.40000000000000009e44Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites40.3%
Taylor expanded in x around 0
Applied rewrites7.9%
if 6.40000000000000009e44 < z Initial program 87.1%
Taylor expanded in x around 0
Applied rewrites18.3%
Taylor expanded in x around inf
Applied rewrites30.7%
(FPCore (x y z) :precision binary64 (if (<= x 2.7) (+ (+ y 0.0007936500793651) 0.91893853320467) (- x 0.5)))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.7) {
tmp = (y + 0.0007936500793651) + 0.91893853320467;
} else {
tmp = x - 0.5;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.7d0) then
tmp = (y + 0.0007936500793651d0) + 0.91893853320467d0
else
tmp = x - 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2.7) {
tmp = (y + 0.0007936500793651) + 0.91893853320467;
} else {
tmp = x - 0.5;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.7: tmp = (y + 0.0007936500793651) + 0.91893853320467 else: tmp = x - 0.5 return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.7) tmp = Float64(Float64(y + 0.0007936500793651) + 0.91893853320467); else tmp = Float64(x - 0.5); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.7) tmp = (y + 0.0007936500793651) + 0.91893853320467; else tmp = x - 0.5; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.7], N[(N[(y + 0.0007936500793651), $MachinePrecision] + 0.91893853320467), $MachinePrecision], N[(x - 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7:\\
\;\;\;\;\left(y + 0.0007936500793651\right) + 0.91893853320467\\
\mathbf{else}:\\
\;\;\;\;x - 0.5\\
\end{array}
\end{array}
if x < 2.7000000000000002Initial program 99.6%
Taylor expanded in x around 0
Applied rewrites3.6%
Taylor expanded in x around 0
Applied rewrites3.5%
Taylor expanded in x around inf
Applied rewrites4.5%
if 2.7000000000000002 < x Initial program 90.8%
Taylor expanded in x around 0
Applied rewrites66.7%
Taylor expanded in x around 0
Applied rewrites10.9%
(FPCore (x y z) :precision binary64 (+ (- x 0.5) 0.91893853320467))
double code(double x, double y, double z) {
return (x - 0.5) + 0.91893853320467;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x - 0.5d0) + 0.91893853320467d0
end function
public static double code(double x, double y, double z) {
return (x - 0.5) + 0.91893853320467;
}
def code(x, y, z): return (x - 0.5) + 0.91893853320467
function code(x, y, z) return Float64(Float64(x - 0.5) + 0.91893853320467) end
function tmp = code(x, y, z) tmp = (x - 0.5) + 0.91893853320467; end
code[x_, y_, z_] := N[(N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision]
\begin{array}{l}
\\
\left(x - 0.5\right) + 0.91893853320467
\end{array}
Initial program 95.2%
Taylor expanded in x around 0
Applied rewrites35.3%
Taylor expanded in x around 0
Applied rewrites7.2%
(FPCore (x y z) :precision binary64 (- x 0.5))
double code(double x, double y, double z) {
return x - 0.5;
}
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
end function
public static double code(double x, double y, double z) {
return x - 0.5;
}
def code(x, y, z): return x - 0.5
function code(x, y, z) return Float64(x - 0.5) end
function tmp = code(x, y, z) tmp = x - 0.5; end
code[x_, y_, z_] := N[(x - 0.5), $MachinePrecision]
\begin{array}{l}
\\
x - 0.5
\end{array}
Initial program 95.2%
Taylor expanded in x around 0
Applied rewrites34.9%
Taylor expanded in x around 0
Applied rewrites6.1%
(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 2024321
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:pre (TRUE)
:alt
(! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))