
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<= x 1.5e+92)
(+
t_0
(+
(/ (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)) x)
(/ 1.0 (* x 12.000000000000048))))
(+ t_0 (* z (* z (/ (+ 0.0007936500793651 y) x)))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 1.5e+92) {
tmp = t_0 + (((z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)) / x) + (1.0 / (x * 12.000000000000048)));
} else {
tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if (x <= 1.5d+92) then
tmp = t_0 + (((z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0)) / x) + (1.0d0 / (x * 12.000000000000048d0)))
else
tmp = t_0 + (z * (z * ((0.0007936500793651d0 + y) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 1.5e+92) {
tmp = t_0 + (((z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)) / x) + (1.0 / (x * 12.000000000000048)));
} else {
tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if x <= 1.5e+92: tmp = t_0 + (((z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)) / x) + (1.0 / (x * 12.000000000000048))) else: tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 1.5e+92) tmp = Float64(t_0 + Float64(Float64(Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) / x) + Float64(1.0 / Float64(x * 12.000000000000048)))); else tmp = Float64(t_0 + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if (x <= 1.5e+92) tmp = t_0 + (((z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)) / x) + (1.0 / (x * 12.000000000000048))); else tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 1.5e+92], N[(t$95$0 + N[(N[(N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 1.5 \cdot 10^{+92}:\\
\;\;\;\;t\_0 + \left(\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \frac{1}{x \cdot 12.000000000000048}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 1.50000000000000007e92Initial program 99.7%
Taylor expanded in z around 0 91.1%
Taylor expanded in x around 0 99.7%
div-inv99.7%
clear-num99.6%
div-inv99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 1.50000000000000007e92 < x Initial program 81.9%
Taylor expanded in z around inf 81.9%
associate-/l*87.5%
unpow287.5%
associate-*l*99.5%
Applied egg-rr99.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(* z (* z (/ (+ 0.0007936500793651 y) x)))
(+ 0.91893853320467 (* (log x) -0.5)))))
(if (<= z -4.5e+20)
t_0
(if (<= z 1.15e-21)
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))
(if (<= z 4.3e+49)
(* (+ 0.0007936500793651 y) (/ (pow z 2.0) x))
(if (<= z 6e+104)
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))
t_0))))))
double code(double x, double y, double z) {
double t_0 = (z * (z * ((0.0007936500793651 + y) / x))) + (0.91893853320467 + (log(x) * -0.5));
double tmp;
if (z <= -4.5e+20) {
tmp = t_0;
} else if (z <= 1.15e-21) {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else if (z <= 4.3e+49) {
tmp = (0.0007936500793651 + y) * (pow(z, 2.0) / x);
} else if (z <= 6e+104) {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (z * (z * ((0.0007936500793651d0 + y) / x))) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
if (z <= (-4.5d+20)) then
tmp = t_0
else if (z <= 1.15d-21) then
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
else if (z <= 4.3d+49) then
tmp = (0.0007936500793651d0 + y) * ((z ** 2.0d0) / x)
else if (z <= 6d+104) then
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (z * (z * ((0.0007936500793651 + y) / x))) + (0.91893853320467 + (Math.log(x) * -0.5));
double tmp;
if (z <= -4.5e+20) {
tmp = t_0;
} else if (z <= 1.15e-21) {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
} else if (z <= 4.3e+49) {
tmp = (0.0007936500793651 + y) * (Math.pow(z, 2.0) / x);
} else if (z <= 6e+104) {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (z * (z * ((0.0007936500793651 + y) / x))) + (0.91893853320467 + (math.log(x) * -0.5)) tmp = 0 if z <= -4.5e+20: tmp = t_0 elif z <= 1.15e-21: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) elif z <= 4.3e+49: tmp = (0.0007936500793651 + y) * (math.pow(z, 2.0) / x) elif z <= 6e+104: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x))) + Float64(0.91893853320467 + Float64(log(x) * -0.5))) tmp = 0.0 if (z <= -4.5e+20) tmp = t_0; elseif (z <= 1.15e-21) tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); elseif (z <= 4.3e+49) tmp = Float64(Float64(0.0007936500793651 + y) * Float64((z ^ 2.0) / x)); elseif (z <= 6e+104) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (z * ((0.0007936500793651 + y) / x))) + (0.91893853320467 + (log(x) * -0.5)); tmp = 0.0; if (z <= -4.5e+20) tmp = t_0; elseif (z <= 1.15e-21) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); elseif (z <= 4.3e+49) tmp = (0.0007936500793651 + y) * ((z ^ 2.0) / x); elseif (z <= 6e+104) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+20], t$95$0, If[LessEqual[z, 1.15e-21], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+49], N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+104], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right) + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+20}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-21}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+49}:\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+104}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.5e20 or 5.99999999999999937e104 < z Initial program 83.0%
Taylor expanded in z around inf 83.0%
Taylor expanded in x around 0 72.7%
+-commutative72.7%
Simplified72.7%
associate-/l*87.6%
unpow287.6%
associate-*l*99.7%
Applied egg-rr78.5%
if -4.5e20 < z < 1.15e-21Initial program 99.5%
Taylor expanded in z around 0 88.9%
if 1.15e-21 < z < 4.2999999999999999e49Initial program 99.7%
Taylor expanded in z around inf 92.4%
Taylor expanded in x around 0 73.1%
+-commutative73.1%
Simplified73.1%
Taylor expanded in x around 0 73.5%
*-commutative73.5%
associate-*r/73.7%
Simplified73.7%
if 4.2999999999999999e49 < z < 5.99999999999999937e104Initial program 91.2%
Taylor expanded in z around 0 68.2%
Taylor expanded in x around inf 68.2%
sub-neg91.2%
mul-1-neg91.2%
log-rec91.2%
remove-double-neg91.2%
metadata-eval91.2%
+-commutative91.2%
Simplified68.2%
Final simplification83.3%
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(+
(*
z
(+ (* (+ 0.0007936500793651 y) (/ z x)) (* 0.0027777777777778 (/ -1.0 x))))
(* (/ 1.0 x) 0.083333333333333))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (((0.0007936500793651 + y) * (z / x)) + (0.0027777777777778 * (-1.0 / x)))) + ((1.0 / x) * 0.083333333333333));
}
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) + ((z * (((0.0007936500793651d0 + y) * (z / x)) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + ((1.0d0 / x) * 0.083333333333333d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((z * (((0.0007936500793651 + y) * (z / x)) + (0.0027777777777778 * (-1.0 / x)))) + ((1.0 / x) * 0.083333333333333));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * (((0.0007936500793651 + y) * (z / x)) + (0.0027777777777778 * (-1.0 / x)))) + ((1.0 / x) * 0.083333333333333))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(Float64(Float64(0.0007936500793651 + y) * Float64(z / x)) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(Float64(1.0 / x) * 0.083333333333333))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (((0.0007936500793651 + y) * (z / x)) + (0.0027777777777778 * (-1.0 / x)))) + ((1.0 / x) * 0.083333333333333)); 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[(z * N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] * 0.083333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right) + \frac{1}{x} \cdot 0.083333333333333\right)
\end{array}
Initial program 92.8%
Taylor expanded in z around 0 94.3%
Taylor expanded in x around 0 98.5%
*-commutative98.5%
associate-/l*99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<= x 6.6e+91)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+ t_0 (* z (* z (/ (+ 0.0007936500793651 y) x)))))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 6.6e+91) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if (x <= 6.6d+91) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = t_0 + (z * (z * ((0.0007936500793651d0 + y) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 6.6e+91) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if x <= 6.6e+91: tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 6.6e+91) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(t_0 + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if (x <= 6.6e+91) tmp = t_0 + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = t_0 + (z * (z * ((0.0007936500793651 + y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 6.6e+91], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 6.6 \cdot 10^{+91}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 6.60000000000000034e91Initial program 99.7%
if 6.60000000000000034e91 < x Initial program 81.9%
Taylor expanded in z around inf 81.9%
associate-/l*87.5%
unpow287.5%
associate-*l*99.5%
Applied egg-rr99.5%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 5.7e-11)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (* (log x) -0.5)))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(* z (* z (/ (+ 0.0007936500793651 y) x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.7e-11) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5));
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (z * (z * ((0.0007936500793651 + y) / 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.7d-11) then
tmp = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + (log(x) * (-0.5d0)))
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (z * (z * ((0.0007936500793651d0 + y) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5.7e-11) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + (Math.log(x) * -0.5));
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.7e-11: tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + (math.log(x) * -0.5)) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (z * (z * ((0.0007936500793651 + y) / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.7e-11) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(log(x) * -0.5))); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5.7e-11) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + (log(x) * -0.5)); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (z * (z * ((0.0007936500793651 + y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.7e-11], 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[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 5.6999999999999997e-11Initial program 99.6%
sub-neg99.6%
associate-+l+99.6%
+-commutative99.6%
sub-neg99.6%
sub-neg99.6%
metadata-eval99.6%
fma-undefine99.6%
add-cube-cbrt99.6%
pow399.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
Simplified99.6%
if 5.6999999999999997e-11 < x Initial program 87.1%
Taylor expanded in z around inf 86.5%
associate-/l*90.4%
unpow290.4%
associate-*l*98.9%
Applied egg-rr98.9%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 8.5e+221)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
t_0)
(+ t_0 (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 8.5e+221) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * (log(x) + (-1.0d0))
if (x <= 8.5d+221) then
tmp = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + t_0
else
tmp = t_0 + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (Math.log(x) + -1.0);
double tmp;
if (x <= 8.5e+221) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0;
} else {
tmp = t_0 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 8.5e+221: tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0 else: tmp = t_0 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 8.5e+221) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0); else tmp = Float64(t_0 + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 8.5e+221) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + t_0; else tmp = t_0 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 8.5e+221], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 8.5 \cdot 10^{+221}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if x < 8.5000000000000004e221Initial program 97.0%
Taylor expanded in x around inf 96.1%
sub-neg96.1%
mul-1-neg96.1%
log-rec96.1%
remove-double-neg96.1%
metadata-eval96.1%
+-commutative96.1%
Simplified96.1%
if 8.5000000000000004e221 < x Initial program 71.2%
Taylor expanded in z around 0 91.2%
Taylor expanded in x around inf 91.2%
sub-neg71.2%
mul-1-neg71.2%
log-rec71.2%
remove-double-neg71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified91.2%
Final simplification95.3%
(FPCore (x y z)
:precision binary64
(if (or (<= z -3.8e+19) (not (<= z 1.15e-21)))
(* (+ 0.0007936500793651 y) (/ (pow z 2.0) x))
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.8e+19) || !(z <= 1.15e-21)) {
tmp = (0.0007936500793651 + y) * (pow(z, 2.0) / x);
} else {
tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-3.8d+19)) .or. (.not. (z <= 1.15d-21))) then
tmp = (0.0007936500793651d0 + y) * ((z ** 2.0d0) / x)
else
tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.8e+19) || !(z <= 1.15e-21)) {
tmp = (0.0007936500793651 + y) * (Math.pow(z, 2.0) / x);
} else {
tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.8e+19) or not (z <= 1.15e-21): tmp = (0.0007936500793651 + y) * (math.pow(z, 2.0) / x) else: tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.8e+19) || !(z <= 1.15e-21)) tmp = Float64(Float64(0.0007936500793651 + y) * Float64((z ^ 2.0) / x)); else tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.8e+19) || ~((z <= 1.15e-21))) tmp = (0.0007936500793651 + y) * ((z ^ 2.0) / x); else tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.8e+19], N[Not[LessEqual[z, 1.15e-21]], $MachinePrecision]], N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+19} \lor \neg \left(z \leq 1.15 \cdot 10^{-21}\right):\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -3.8e19 or 1.15e-21 < z Initial program 85.2%
Taylor expanded in z around inf 84.6%
Taylor expanded in x around 0 68.9%
+-commutative68.9%
Simplified68.9%
Taylor expanded in x around 0 69.1%
*-commutative69.1%
associate-*r/71.3%
Simplified71.3%
if -3.8e19 < z < 1.15e-21Initial program 99.5%
Taylor expanded in z around 0 88.9%
Final simplification80.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.9e+19) (not (<= z 1.15e-21))) (* (+ 0.0007936500793651 y) (/ (pow z 2.0) x)) (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.9e+19) || !(z <= 1.15e-21)) {
tmp = (0.0007936500793651 + y) * (pow(z, 2.0) / x);
} else {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.9d+19)) .or. (.not. (z <= 1.15d-21))) then
tmp = (0.0007936500793651d0 + y) * ((z ** 2.0d0) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.9e+19) || !(z <= 1.15e-21)) {
tmp = (0.0007936500793651 + y) * (Math.pow(z, 2.0) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.9e+19) or not (z <= 1.15e-21): tmp = (0.0007936500793651 + y) * (math.pow(z, 2.0) / x) else: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.9e+19) || !(z <= 1.15e-21)) tmp = Float64(Float64(0.0007936500793651 + y) * Float64((z ^ 2.0) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.9e+19) || ~((z <= 1.15e-21))) tmp = (0.0007936500793651 + y) * ((z ^ 2.0) / x); else tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.9e+19], N[Not[LessEqual[z, 1.15e-21]], $MachinePrecision]], N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+19} \lor \neg \left(z \leq 1.15 \cdot 10^{-21}\right):\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.9e19 or 1.15e-21 < z Initial program 85.2%
Taylor expanded in z around inf 84.6%
Taylor expanded in x around 0 68.9%
+-commutative68.9%
Simplified68.9%
Taylor expanded in x around 0 69.1%
*-commutative69.1%
associate-*r/71.3%
Simplified71.3%
if -1.9e19 < z < 1.15e-21Initial program 99.5%
Taylor expanded in z around 0 88.9%
Taylor expanded in x around inf 87.4%
sub-neg97.9%
mul-1-neg97.9%
log-rec97.9%
remove-double-neg97.9%
metadata-eval97.9%
+-commutative97.9%
Simplified87.4%
Final simplification79.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.05e-25) (not (<= z 5.4e-60))) (* (+ 0.0007936500793651 y) (/ (pow z 2.0) x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.05e-25) || !(z <= 5.4e-60)) {
tmp = (0.0007936500793651 + y) * (pow(z, 2.0) / x);
} else {
tmp = 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.05d-25)) .or. (.not. (z <= 5.4d-60))) then
tmp = (0.0007936500793651d0 + y) * ((z ** 2.0d0) / x)
else
tmp = 0.083333333333333d0 / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.05e-25) || !(z <= 5.4e-60)) {
tmp = (0.0007936500793651 + y) * (Math.pow(z, 2.0) / x);
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.05e-25) or not (z <= 5.4e-60): tmp = (0.0007936500793651 + y) * (math.pow(z, 2.0) / x) else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.05e-25) || !(z <= 5.4e-60)) tmp = Float64(Float64(0.0007936500793651 + y) * Float64((z ^ 2.0) / x)); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.05e-25) || ~((z <= 5.4e-60))) tmp = (0.0007936500793651 + y) * ((z ^ 2.0) / x); else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.05e-25], N[Not[LessEqual[z, 5.4e-60]], $MachinePrecision]], N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-60}\right):\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.05000000000000001e-25 or 5.40000000000000001e-60 < z Initial program 87.6%
Taylor expanded in z around inf 84.7%
Taylor expanded in x around 0 63.4%
+-commutative63.4%
Simplified63.4%
Taylor expanded in x around 0 63.7%
*-commutative63.7%
associate-*r/65.5%
Simplified65.5%
if -1.05000000000000001e-25 < z < 5.40000000000000001e-60Initial program 99.5%
Taylor expanded in z around 0 94.3%
Taylor expanded in x around inf 92.5%
sub-neg97.6%
mul-1-neg97.6%
log-rec97.6%
remove-double-neg97.6%
metadata-eval97.6%
+-commutative97.6%
Simplified92.5%
Taylor expanded in x around 0 47.6%
Final simplification57.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.1e-25) (not (<= z 2e-59))) (* y (/ (pow z 2.0) x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.1e-25) || !(z <= 2e-59)) {
tmp = y * (pow(z, 2.0) / x);
} else {
tmp = 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 <= (-2.1d-25)) .or. (.not. (z <= 2d-59))) then
tmp = y * ((z ** 2.0d0) / x)
else
tmp = 0.083333333333333d0 / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.1e-25) || !(z <= 2e-59)) {
tmp = y * (Math.pow(z, 2.0) / x);
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.1e-25) or not (z <= 2e-59): tmp = y * (math.pow(z, 2.0) / x) else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.1e-25) || !(z <= 2e-59)) tmp = Float64(y * Float64((z ^ 2.0) / x)); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.1e-25) || ~((z <= 2e-59))) tmp = y * ((z ^ 2.0) / x); else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.1e-25], N[Not[LessEqual[z, 2e-59]], $MachinePrecision]], N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-25} \lor \neg \left(z \leq 2 \cdot 10^{-59}\right):\\
\;\;\;\;y \cdot \frac{{z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.10000000000000002e-25 or 2.0000000000000001e-59 < z Initial program 87.6%
Taylor expanded in z around inf 84.7%
Taylor expanded in x around 0 63.4%
+-commutative63.4%
Simplified63.4%
Taylor expanded in y around inf 49.3%
associate-/l*51.8%
Simplified51.8%
if -2.10000000000000002e-25 < z < 2.0000000000000001e-59Initial program 99.5%
Taylor expanded in z around 0 94.3%
Taylor expanded in x around inf 92.5%
sub-neg97.6%
mul-1-neg97.6%
log-rec97.6%
remove-double-neg97.6%
metadata-eval97.6%
+-commutative97.6%
Simplified92.5%
Taylor expanded in x around 0 47.6%
Final simplification50.0%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 92.8%
Taylor expanded in z around 0 60.5%
Taylor expanded in x around inf 59.7%
sub-neg92.0%
mul-1-neg92.0%
log-rec92.0%
remove-double-neg92.0%
metadata-eval92.0%
+-commutative92.0%
Simplified59.7%
Taylor expanded in x around 0 23.8%
(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 2024089
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))