
(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 16 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
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(+ (* z (* (/ z x) (+ 0.0007936500793651 y))) (* (log x) (- x 0.5)))))
x))
double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z / x) * (0.0007936500793651 + y))) + (log(x) * (x - 0.5))))) - x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + ((z * ((z / x) * (0.0007936500793651d0 + y))) + (log(x) * (x - 0.5d0))))) - x
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z / x) * (0.0007936500793651 + y))) + (Math.log(x) * (x - 0.5))))) - x;
}
def code(x, y, z): return (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z / x) * (0.0007936500793651 + y))) + (math.log(x) * (x - 0.5))))) - x
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z * Float64(Float64(z / x) * Float64(0.0007936500793651 + y))) + Float64(log(x) * Float64(x - 0.5))))) - x) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + ((z * ((z / x) * (0.0007936500793651 + y))) + (log(x) * (x - 0.5))))) - x; end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) + \log x \cdot \left(x - 0.5\right)\right)\right)\right) - x
\end{array}
Initial program 94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
unsub-neg94.3%
distribute-frac-neg294.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in z around 0 93.9%
Taylor expanded in z around inf 90.2%
unpow290.2%
associate-*r/90.2%
metadata-eval90.2%
associate-*l*93.8%
distribute-rgt-in86.4%
associate-*l/86.4%
associate-*r/86.4%
associate-*l/90.6%
associate-/l*89.7%
distribute-rgt-out99.1%
Simplified99.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (log x) (- x 0.5))))
(if (<= x 7.4e+131)
(+
(+ 0.91893853320467 (- t_0 x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(-
(+
0.91893853320467
(+ (* 0.083333333333333 (/ 1.0 x)) (+ t_0 (* z (* z (/ y x))))))
x))))
double code(double x, double y, double z) {
double t_0 = log(x) * (x - 0.5);
double tmp;
if (x <= 7.4e+131) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (y / 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) :: t_0
real(8) :: tmp
t_0 = log(x) * (x - 0.5d0)
if (x <= 7.4d+131) then
tmp = (0.91893853320467d0 + (t_0 - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + (t_0 + (z * (z * (y / x)))))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.log(x) * (x - 0.5);
double tmp;
if (x <= 7.4e+131) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (y / x)))))) - x;
}
return tmp;
}
def code(x, y, z): t_0 = math.log(x) * (x - 0.5) tmp = 0 if x <= 7.4e+131: tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (y / x)))))) - x return tmp
function code(x, y, z) t_0 = Float64(log(x) * Float64(x - 0.5)) tmp = 0.0 if (x <= 7.4e+131) tmp = Float64(Float64(0.91893853320467 + Float64(t_0 - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(t_0 + Float64(z * Float64(z * Float64(y / x)))))) - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = log(x) * (x - 0.5); tmp = 0.0; if (x <= 7.4e+131) tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (y / x)))))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 7.4e+131], N[(N[(0.91893853320467 + N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x - 0.5\right)\\
\mathbf{if}\;x \leq 7.4 \cdot 10^{+131}:\\
\;\;\;\;\left(0.91893853320467 + \left(t\_0 - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(t\_0 + z \cdot \left(z \cdot \frac{y}{x}\right)\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 7.3999999999999999e131Initial program 98.7%
if 7.3999999999999999e131 < x Initial program 79.5%
remove-double-neg79.5%
distribute-frac-neg279.5%
sub-neg79.5%
associate-+l+79.5%
fma-define79.6%
sub-neg79.6%
metadata-eval79.6%
+-commutative79.6%
unsub-neg79.6%
distribute-frac-neg279.6%
remove-double-neg79.6%
Simplified79.6%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 85.9%
unpow285.9%
associate-*r/85.9%
metadata-eval85.9%
associate-*l*99.5%
distribute-rgt-in99.5%
associate-*l/99.5%
associate-*r/99.5%
associate-*l/94.8%
associate-/l*99.5%
distribute-rgt-out99.5%
Simplified99.5%
Taylor expanded in y around inf 89.0%
*-commutative89.0%
associate-*r/93.7%
Simplified93.7%
Final simplification97.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (log x) (- x 0.5))))
(if (<= x 3e+131)
(+
(+ 0.91893853320467 (- t_0 x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(-
(+
0.91893853320467
(+
(* 0.083333333333333 (/ 1.0 x))
(+ t_0 (* z (* z (/ 0.0007936500793651 x))))))
x))))
double code(double x, double y, double z) {
double t_0 = log(x) * (x - 0.5);
double tmp;
if (x <= 3e+131) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (0.0007936500793651 / 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) :: t_0
real(8) :: tmp
t_0 = log(x) * (x - 0.5d0)
if (x <= 3d+131) then
tmp = (0.91893853320467d0 + (t_0 - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = (0.91893853320467d0 + ((0.083333333333333d0 * (1.0d0 / x)) + (t_0 + (z * (z * (0.0007936500793651d0 / x)))))) - x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.log(x) * (x - 0.5);
double tmp;
if (x <= 3e+131) {
tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (0.0007936500793651 / x)))))) - x;
}
return tmp;
}
def code(x, y, z): t_0 = math.log(x) * (x - 0.5) tmp = 0 if x <= 3e+131: tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (0.0007936500793651 / x)))))) - x return tmp
function code(x, y, z) t_0 = Float64(log(x) * Float64(x - 0.5)) tmp = 0.0 if (x <= 3e+131) tmp = Float64(Float64(0.91893853320467 + Float64(t_0 - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(t_0 + Float64(z * Float64(z * Float64(0.0007936500793651 / x)))))) - x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = log(x) * (x - 0.5); tmp = 0.0; if (x <= 3e+131) tmp = (0.91893853320467 + (t_0 - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = (0.91893853320467 + ((0.083333333333333 * (1.0 / x)) + (t_0 + (z * (z * (0.0007936500793651 / x)))))) - x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3e+131], N[(N[(0.91893853320467 + N[(t$95$0 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 + N[(z * N[(z * N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log x \cdot \left(x - 0.5\right)\\
\mathbf{if}\;x \leq 3 \cdot 10^{+131}:\\
\;\;\;\;\left(0.91893853320467 + \left(t\_0 - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(0.083333333333333 \cdot \frac{1}{x} + \left(t\_0 + z \cdot \left(z \cdot \frac{0.0007936500793651}{x}\right)\right)\right)\right) - x\\
\end{array}
\end{array}
if x < 3.0000000000000001e131Initial program 98.7%
if 3.0000000000000001e131 < x Initial program 79.9%
remove-double-neg79.9%
distribute-frac-neg279.9%
sub-neg79.9%
associate-+l+79.9%
fma-define79.9%
sub-neg79.9%
metadata-eval79.9%
+-commutative79.9%
unsub-neg79.9%
distribute-frac-neg279.9%
remove-double-neg79.9%
Simplified79.9%
Taylor expanded in z around 0 99.5%
Taylor expanded in z around inf 86.2%
unpow286.2%
associate-*r/86.2%
metadata-eval86.2%
associate-*l*99.5%
distribute-rgt-in99.5%
associate-*l/99.5%
associate-*r/99.5%
associate-*l/94.9%
associate-/l*99.5%
distribute-rgt-out99.5%
Simplified99.5%
Taylor expanded in y around 0 92.8%
*-commutative92.8%
associate-*l/92.8%
associate-*r/92.9%
Simplified92.9%
Final simplification97.3%
(FPCore (x y z)
:precision binary64
(if (or (<= z -6.8e+36) (not (<= z 9e+24)))
(+
(* 0.083333333333333 (/ 1.0 x))
(*
z
(+
(* z (+ (/ y x) (* (/ 1.0 x) 0.0007936500793651)))
(* 0.0027777777777778 (/ -1.0 x)))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 1.0 (* x 12.000000000000048)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.8e+36) || !(z <= 9e+24)) {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x))));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (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) :: tmp
if ((z <= (-6.8d+36)) .or. (.not. (z <= 9d+24))) then
tmp = (0.083333333333333d0 * (1.0d0 / x)) + (z * ((z * ((y / x) + ((1.0d0 / x) * 0.0007936500793651d0))) + (0.0027777777777778d0 * ((-1.0d0) / x))))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (1.0d0 / (x * 12.000000000000048d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6.8e+36) || !(z <= 9e+24)) {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x))));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.8e+36) or not (z <= 9e+24): tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x)))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.8e+36) || !(z <= 9e+24)) tmp = Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(z * Float64(Float64(y / x) + Float64(Float64(1.0 / x) * 0.0007936500793651))) + Float64(0.0027777777777778 * Float64(-1.0 / x))))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(1.0 / Float64(x * 12.000000000000048))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.8e+36) || ~((z <= 9e+24))) tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x)))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (1.0 / (x * 12.000000000000048)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.8e+36], N[Not[LessEqual[z, 9e+24]], $MachinePrecision]], N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(N[(y / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+36} \lor \neg \left(z \leq 9 \cdot 10^{+24}\right):\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{1}{x} \cdot 0.0007936500793651\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -6.7999999999999996e36 or 9.00000000000000039e24 < z Initial program 90.4%
remove-double-neg90.4%
distribute-frac-neg290.4%
sub-neg90.4%
associate-+l+90.4%
fma-define90.5%
sub-neg90.5%
metadata-eval90.5%
+-commutative90.5%
unsub-neg90.5%
distribute-frac-neg290.5%
remove-double-neg90.5%
Simplified90.5%
Taylor expanded in x around 0 82.2%
Taylor expanded in z around -inf 82.2%
mul-1-neg82.2%
unsub-neg82.2%
sub-neg82.2%
associate-*r/82.2%
metadata-eval82.2%
distribute-neg-frac82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around 0 85.0%
if -6.7999999999999996e36 < z < 9.00000000000000039e24Initial program 98.6%
clear-num98.5%
inv-pow98.5%
*-commutative98.5%
fma-undefine98.5%
fmm-def98.5%
metadata-eval98.5%
Applied egg-rr98.5%
unpow-198.5%
fma-define98.5%
+-commutative98.5%
*-commutative98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around 0 93.8%
*-commutative93.8%
Simplified93.8%
Final simplification89.1%
(FPCore (x y z)
:precision binary64
(if (or (<= z -1.42e+36) (not (<= z 9e+24)))
(+
(* 0.083333333333333 (/ 1.0 x))
(*
z
(+
(* z (+ (/ y x) (* (/ 1.0 x) 0.0007936500793651)))
(* 0.0027777777777778 (/ -1.0 x)))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.42e+36) || !(z <= 9e+24)) {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x))));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.42d+36)) .or. (.not. (z <= 9d+24))) then
tmp = (0.083333333333333d0 * (1.0d0 / x)) + (z * ((z * ((y / x) + ((1.0d0 / x) * 0.0007936500793651d0))) + (0.0027777777777778d0 * ((-1.0d0) / x))))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.42e+36) || !(z <= 9e+24)) {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x))));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.42e+36) or not (z <= 9e+24): tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x)))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.42e+36) || !(z <= 9e+24)) tmp = Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(z * Float64(Float64(y / x) + Float64(Float64(1.0 / x) * 0.0007936500793651))) + Float64(0.0027777777777778 * Float64(-1.0 / x))))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.42e+36) || ~((z <= 9e+24))) tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((y / x) + ((1.0 / x) * 0.0007936500793651))) + (0.0027777777777778 * (-1.0 / x)))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.42e+36], N[Not[LessEqual[z, 9e+24]], $MachinePrecision]], N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(N[(y / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+36} \lor \neg \left(z \leq 9 \cdot 10^{+24}\right):\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{1}{x} \cdot 0.0007936500793651\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.42e36 or 9.00000000000000039e24 < z Initial program 90.4%
remove-double-neg90.4%
distribute-frac-neg290.4%
sub-neg90.4%
associate-+l+90.4%
fma-define90.5%
sub-neg90.5%
metadata-eval90.5%
+-commutative90.5%
unsub-neg90.5%
distribute-frac-neg290.5%
remove-double-neg90.5%
Simplified90.5%
Taylor expanded in x around 0 82.2%
Taylor expanded in z around -inf 82.2%
mul-1-neg82.2%
unsub-neg82.2%
sub-neg82.2%
associate-*r/82.2%
metadata-eval82.2%
distribute-neg-frac82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around 0 85.0%
if -1.42e36 < z < 9.00000000000000039e24Initial program 98.6%
Taylor expanded in z around 0 93.8%
Final simplification89.1%
(FPCore (x y z)
:precision binary64
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
return (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z): return (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 94.2%
Final simplification94.2%
(FPCore (x y z)
:precision binary64
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (- (* x (log x)) x))))
double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * log(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 = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((x * log(x)) - x))
end function
public static double code(double x, double y, double z) {
return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
}
def code(x, y, z): return ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * math.log(x)) - x))
function code(x, y, z) return Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))) end
function tmp = code(x, y, z) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * log(x)) - x)); end
code[x_, y_, z_] := N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)
\end{array}
Initial program 94.2%
Taylor expanded in x around inf 93.9%
mul-1-neg93.9%
distribute-rgt-neg-in93.9%
log-rec93.9%
remove-double-neg93.9%
Simplified93.9%
Final simplification93.9%
(FPCore (x y z)
:precision binary64
(if (<= x 6.4e+58)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.4e+58) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 6.4d+58) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 6.4e+58) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 6.4e+58: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 6.4e+58) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 6.4e+58) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6.4e+58], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.4 \cdot 10^{+58}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 6.40000000000000031e58Initial program 99.7%
remove-double-neg99.7%
distribute-frac-neg299.7%
sub-neg99.7%
associate-+l+99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
unsub-neg99.7%
distribute-frac-neg299.7%
remove-double-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 94.7%
if 6.40000000000000031e58 < x Initial program 84.9%
remove-double-neg84.9%
distribute-frac-neg284.9%
sub-neg84.9%
associate-+l+84.9%
fma-define84.9%
sub-neg84.9%
metadata-eval84.9%
+-commutative84.9%
unsub-neg84.9%
distribute-frac-neg284.9%
remove-double-neg84.9%
Simplified84.9%
Taylor expanded in x around inf 68.2%
sub-neg68.2%
mul-1-neg68.2%
log-rec68.2%
remove-double-neg68.2%
metadata-eval68.2%
Simplified68.2%
(FPCore (x y z)
:precision binary64
(if (or (<= y -3000000.0) (not (<= y 0.0008)))
(/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x)
(/
(+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3000000.0) || !(y <= 0.0008)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-3000000.0d0)) .or. (.not. (y <= 0.0008d0))) then
tmp = (0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x
else
tmp = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3000000.0) || !(y <= 0.0008)) {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3000000.0) or not (y <= 0.0008): tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x else: tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3000000.0) || !(y <= 0.0008)) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x); else tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3000000.0) || ~((y <= 0.0008))) tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x; else tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3000000.0], N[Not[LessEqual[y, 0.0008]], $MachinePrecision]], N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3000000 \lor \neg \left(y \leq 0.0008\right):\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -3e6 or 8.00000000000000038e-4 < y Initial program 94.3%
remove-double-neg94.3%
distribute-frac-neg294.3%
sub-neg94.3%
associate-+l+94.3%
fma-define94.4%
sub-neg94.4%
metadata-eval94.4%
+-commutative94.4%
unsub-neg94.4%
distribute-frac-neg294.4%
remove-double-neg94.4%
Simplified94.4%
Taylor expanded in x around 0 74.6%
Taylor expanded in y around inf 74.6%
*-commutative74.6%
Simplified74.6%
if -3e6 < y < 8.00000000000000038e-4Initial program 94.1%
remove-double-neg94.1%
distribute-frac-neg294.1%
sub-neg94.1%
associate-+l+94.1%
fma-define94.1%
sub-neg94.1%
metadata-eval94.1%
+-commutative94.1%
unsub-neg94.1%
distribute-frac-neg294.1%
remove-double-neg94.1%
Simplified94.1%
Taylor expanded in x around 0 64.8%
Taylor expanded in y around 0 64.8%
*-commutative64.8%
Simplified64.8%
Final simplification70.2%
(FPCore (x y z)
:precision binary64
(if (<= y -2.25e+18)
(+ (* 0.083333333333333 (/ 1.0 x)) (* (/ z x) -0.0027777777777778))
(/
(+ 0.083333333333333 (* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x)))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.25e+18) {
tmp = (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778);
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-2.25d+18)) then
tmp = (0.083333333333333d0 * (1.0d0 / x)) + ((z / x) * (-0.0027777777777778d0))
else
tmp = (0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.25e+18) {
tmp = (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778);
} else {
tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.25e+18: tmp = (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778) else: tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.25e+18) tmp = Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z / x) * -0.0027777777777778)); else tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.25e+18) tmp = (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778); else tmp = (0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.25e+18], N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * -0.0027777777777778), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+18}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x} + \frac{z}{x} \cdot -0.0027777777777778\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if y < -2.25e18Initial program 93.9%
remove-double-neg93.9%
distribute-frac-neg293.9%
sub-neg93.9%
associate-+l+93.9%
fma-define93.9%
sub-neg93.9%
metadata-eval93.9%
+-commutative93.9%
unsub-neg93.9%
distribute-frac-neg293.9%
remove-double-neg93.9%
Simplified93.9%
Taylor expanded in x around 0 79.4%
Taylor expanded in z around -inf 62.5%
mul-1-neg62.5%
unsub-neg62.5%
sub-neg62.5%
associate-*r/62.5%
metadata-eval62.5%
distribute-neg-frac62.5%
metadata-eval62.5%
Simplified62.5%
Taylor expanded in z around 0 32.9%
if -2.25e18 < y Initial program 94.3%
remove-double-neg94.3%
distribute-frac-neg294.3%
sub-neg94.3%
associate-+l+94.3%
fma-define94.4%
sub-neg94.4%
metadata-eval94.4%
+-commutative94.4%
unsub-neg94.4%
distribute-frac-neg294.4%
remove-double-neg94.4%
Simplified94.4%
Taylor expanded in x around 0 67.0%
Taylor expanded in y around 0 60.1%
*-commutative60.1%
Simplified60.1%
Final simplification53.1%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Initial program 94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
unsub-neg94.3%
distribute-frac-neg294.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around 0 70.2%
(FPCore (x y z) :precision binary64 (+ (* 0.083333333333333 (/ 1.0 x)) (* (/ z x) -0.0027777777777778)))
double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + ((z / x) * -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 = (0.083333333333333d0 * (1.0d0 / x)) + ((z / x) * (-0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778);
}
def code(x, y, z): return (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778)
function code(x, y, z) return Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(Float64(z / x) * -0.0027777777777778)) end
function tmp = code(x, y, z) tmp = (0.083333333333333 * (1.0 / x)) + ((z / x) * -0.0027777777777778); end
code[x_, y_, z_] := N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * -0.0027777777777778), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x} + \frac{z}{x} \cdot -0.0027777777777778
\end{array}
Initial program 94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
unsub-neg94.3%
distribute-frac-neg294.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around 0 70.2%
Taylor expanded in z around -inf 54.5%
mul-1-neg54.5%
unsub-neg54.5%
sub-neg54.5%
associate-*r/54.5%
metadata-eval54.5%
distribute-neg-frac54.5%
metadata-eval54.5%
Simplified54.5%
Taylor expanded in z around 0 33.3%
Final simplification33.3%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * -0.0027777777777778)) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Initial program 94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
unsub-neg94.3%
distribute-frac-neg294.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around 0 70.2%
Taylor expanded in z around 0 33.3%
*-commutative33.3%
Simplified33.3%
(FPCore (x y z) :precision binary64 (/ 1.0 (* x 12.000000000000048)))
double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / (x * 12.000000000000048d0)
end function
public static double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
def code(x, y, z): return 1.0 / (x * 12.000000000000048)
function code(x, y, z) return Float64(1.0 / Float64(x * 12.000000000000048)) end
function tmp = code(x, y, z) tmp = 1.0 / (x * 12.000000000000048); end
code[x_, y_, z_] := N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot 12.000000000000048}
\end{array}
Initial program 94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
unsub-neg94.3%
distribute-frac-neg294.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around 0 70.2%
Taylor expanded in z around 0 25.2%
clear-num25.1%
inv-pow25.1%
div-inv25.2%
metadata-eval25.2%
Applied egg-rr25.2%
unpow-125.2%
Applied egg-rr25.2%
(FPCore (x y z) :precision binary64 (* 0.083333333333333 (/ 1.0 x)))
double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 * (1.0d0 / x)
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 * (1.0 / x);
}
def code(x, y, z): return 0.083333333333333 * (1.0 / x)
function code(x, y, z) return Float64(0.083333333333333 * Float64(1.0 / x)) end
function tmp = code(x, y, z) tmp = 0.083333333333333 * (1.0 / x); end
code[x_, y_, z_] := N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x}
\end{array}
Initial program 94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
unsub-neg94.3%
distribute-frac-neg294.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around 0 70.2%
Taylor expanded in z around 0 25.2%
div-inv25.2%
Applied egg-rr25.2%
(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 94.2%
remove-double-neg94.2%
distribute-frac-neg294.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.3%
sub-neg94.3%
metadata-eval94.3%
+-commutative94.3%
unsub-neg94.3%
distribute-frac-neg294.3%
remove-double-neg94.3%
Simplified94.3%
Taylor expanded in x around 0 70.2%
Taylor expanded in z around 0 25.2%
(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 2024157
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))