
(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 12 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))))
(if (<= x 5e+43)
(+
(+
(/ (- (pow t_0 3.0) (pow x 3.0)) (+ (pow t_0 2.0) (* x (+ x t_0))))
0.91893853320467)
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (* z (+ (/ y x) (/ 0.0007936500793651 x))))))))
double code(double x, double y, double z) {
double t_0 = (x + -0.5) * log(x);
double tmp;
if (x <= 5e+43) {
tmp = (((pow(t_0, 3.0) - pow(x, 3.0)) / (pow(t_0, 2.0) + (x * (x + t_0)))) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x + (-0.5d0)) * log(x)
if (x <= 5d+43) then
tmp = ((((t_0 ** 3.0d0) - (x ** 3.0d0)) / ((t_0 ** 2.0d0) + (x * (x + t_0)))) + 0.91893853320467d0) + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (z * (z * ((y / x) + (0.0007936500793651d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + -0.5) * Math.log(x);
double tmp;
if (x <= 5e+43) {
tmp = (((Math.pow(t_0, 3.0) - Math.pow(x, 3.0)) / (Math.pow(t_0, 2.0) + (x * (x + t_0)))) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
def code(x, y, z): t_0 = (x + -0.5) * math.log(x) tmp = 0 if x <= 5e+43: tmp = (((math.pow(t_0, 3.0) - math.pow(x, 3.0)) / (math.pow(t_0, 2.0) + (x * (x + t_0)))) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))) return tmp
function code(x, y, z) t_0 = Float64(Float64(x + -0.5) * log(x)) tmp = 0.0 if (x <= 5e+43) tmp = Float64(Float64(Float64(Float64((t_0 ^ 3.0) - (x ^ 3.0)) / Float64((t_0 ^ 2.0) + Float64(x * Float64(x + t_0)))) + 0.91893853320467) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + -0.5) * log(x); tmp = 0.0; if (x <= 5e+43) tmp = ((((t_0 ^ 3.0) - (x ^ 3.0)) / ((t_0 ^ 2.0) + (x * (x + t_0)))) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5e+43], N[(N[(N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] - N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(x * N[(x + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + -0.5\right) \cdot \log x\\
\mathbf{if}\;x \leq 5 \cdot 10^{+43}:\\
\;\;\;\;\left(\frac{{t_0}^{3} - {x}^{3}}{{t_0}^{2} + x \cdot \left(x + t_0\right)} + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if x < 5.0000000000000004e43Initial program 99.7%
flip3--99.7%
sub-neg99.7%
metadata-eval99.7%
pow299.7%
sub-neg99.7%
metadata-eval99.7%
distribute-rgt-out99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 5.0000000000000004e43 < x Initial program 87.5%
Taylor expanded in z around inf 87.5%
+-commutative87.5%
fma-def87.5%
associate-/l*90.8%
+-commutative90.8%
associate-/r/90.8%
unpow290.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in z around inf 90.7%
unpow290.7%
*-commutative90.7%
associate-*l*99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(t_1 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= t_0 -1e+63)
(+ t_1 (* y (* z (/ z x))))
(if (<= t_0 2000000.0)
(+ t_1 (/ 0.083333333333333 x))
(+ t_1 (* z (* z (/ 0.0007936500793651 x))))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (t_0 <= -1e+63) {
tmp = t_1 + (y * (z * (z / x)));
} else if (t_0 <= 2000000.0) {
tmp = t_1 + (0.083333333333333 / x);
} else {
tmp = t_1 + (z * (z * (0.0007936500793651 / 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) :: t_1
real(8) :: tmp
t_0 = z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)
t_1 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (t_0 <= (-1d+63)) then
tmp = t_1 + (y * (z * (z / x)))
else if (t_0 <= 2000000.0d0) then
tmp = t_1 + (0.083333333333333d0 / x)
else
tmp = t_1 + (z * (z * (0.0007936500793651d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double t_1 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (t_0 <= -1e+63) {
tmp = t_1 + (y * (z * (z / x)));
} else if (t_0 <= 2000000.0) {
tmp = t_1 + (0.083333333333333 / x);
} else {
tmp = t_1 + (z * (z * (0.0007936500793651 / x)));
}
return tmp;
}
def code(x, y, z): t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778) t_1 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if t_0 <= -1e+63: tmp = t_1 + (y * (z * (z / x))) elif t_0 <= 2000000.0: tmp = t_1 + (0.083333333333333 / x) else: tmp = t_1 + (z * (z * (0.0007936500793651 / x))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (t_0 <= -1e+63) tmp = Float64(t_1 + Float64(y * Float64(z * Float64(z / x)))); elseif (t_0 <= 2000000.0) tmp = Float64(t_1 + Float64(0.083333333333333 / x)); else tmp = Float64(t_1 + Float64(z * Float64(z * Float64(0.0007936500793651 / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778); t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (t_0 <= -1e+63) tmp = t_1 + (y * (z * (z / x))); elseif (t_0 <= 2000000.0) tmp = t_1 + (0.083333333333333 / x); else tmp = t_1 + (z * (z * (0.0007936500793651 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+63], N[(t$95$1 + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2000000.0], N[(t$95$1 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(z * N[(z * N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+63}:\\
\;\;\;\;t_1 + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;t_0 \leq 2000000:\\
\;\;\;\;t_1 + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_1 + z \cdot \left(z \cdot \frac{0.0007936500793651}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -1.00000000000000006e63Initial program 90.6%
Taylor expanded in y around inf 90.0%
associate-/l*96.8%
unpow296.8%
Simplified96.8%
div-inv96.8%
clear-num96.9%
associate-/l*99.3%
Applied egg-rr99.3%
associate-/r/99.2%
Simplified99.2%
if -1.00000000000000006e63 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 2e6Initial program 99.5%
Taylor expanded in z around 0 98.5%
if 2e6 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 88.7%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
fma-def76.6%
associate-/l*77.6%
+-commutative77.6%
associate-/r/77.7%
unpow277.7%
+-commutative77.7%
Simplified77.7%
Taylor expanded in z around inf 89.5%
unpow289.5%
*-commutative89.5%
associate-*l*99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 93.8%
associate-*r/93.8%
associate-*l/93.8%
*-commutative93.8%
Simplified93.8%
Final simplification96.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 300000.0)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
t_0)
(+ t_0 (* z (* z (+ (/ y x) (/ 0.0007936500793651 x))))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 300000.0) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / 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 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 300000.0d0) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + t_0
else
tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 300000.0) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0;
} else {
tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 300000.0: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0 else: tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / x)))) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 300000.0) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0); else tmp = Float64(t_0 + Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 300000.0) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + t_0; else tmp = t_0 + (z * (z * ((y / x) + (0.0007936500793651 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 300000.0], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 300000:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if x < 3e5Initial program 99.7%
if 3e5 < x Initial program 89.2%
Taylor expanded in z around inf 89.2%
+-commutative89.2%
fma-def89.2%
associate-/l*92.0%
+-commutative92.0%
associate-/r/92.0%
unpow292.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in z around inf 92.0%
unpow292.0%
*-commutative92.0%
associate-*l*99.5%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (* z z) (/ x (+ y 0.0007936500793651)))))
(t_1 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= z -5.2e+154)
t_0
(if (<= z -2.25e+108)
(+ t_1 (* y (* z (/ z x))))
(if (or (<= z -8.8e+30) (not (<= z 5.1e+20)))
t_0
(+ t_1 (/ 0.083333333333333 x)))))))
double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651)));
double t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (z <= -5.2e+154) {
tmp = t_0;
} else if (z <= -2.25e+108) {
tmp = t_1 + (y * (z * (z / x)));
} else if ((z <= -8.8e+30) || !(z <= 5.1e+20)) {
tmp = t_0;
} else {
tmp = t_1 + (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) :: t_1
real(8) :: tmp
t_0 = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((z * z) / (x / (y + 0.0007936500793651d0)))
t_1 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (z <= (-5.2d+154)) then
tmp = t_0
else if (z <= (-2.25d+108)) then
tmp = t_1 + (y * (z * (z / x)))
else if ((z <= (-8.8d+30)) .or. (.not. (z <= 5.1d+20))) then
tmp = t_0
else
tmp = t_1 + (0.083333333333333d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (0.91893853320467 + (-0.5 * Math.log(x))) + ((z * z) / (x / (y + 0.0007936500793651)));
double t_1 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (z <= -5.2e+154) {
tmp = t_0;
} else if (z <= -2.25e+108) {
tmp = t_1 + (y * (z * (z / x)));
} else if ((z <= -8.8e+30) || !(z <= 5.1e+20)) {
tmp = t_0;
} else {
tmp = t_1 + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): t_0 = (0.91893853320467 + (-0.5 * math.log(x))) + ((z * z) / (x / (y + 0.0007936500793651))) t_1 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if z <= -5.2e+154: tmp = t_0 elif z <= -2.25e+108: tmp = t_1 + (y * (z * (z / x))) elif (z <= -8.8e+30) or not (z <= 5.1e+20): tmp = t_0 else: tmp = t_1 + (0.083333333333333 / x) return tmp
function code(x, y, z) t_0 = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(z * z) / Float64(x / Float64(y + 0.0007936500793651)))) t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (z <= -5.2e+154) tmp = t_0; elseif (z <= -2.25e+108) tmp = Float64(t_1 + Float64(y * Float64(z * Float64(z / x)))); elseif ((z <= -8.8e+30) || !(z <= 5.1e+20)) tmp = t_0; else tmp = Float64(t_1 + Float64(0.083333333333333 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651))); t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (z <= -5.2e+154) tmp = t_0; elseif (z <= -2.25e+108) tmp = t_1 + (y * (z * (z / x))); elseif ((z <= -8.8e+30) || ~((z <= 5.1e+20))) tmp = t_0; else tmp = t_1 + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+154], t$95$0, If[LessEqual[z, -2.25e+108], N[(t$95$1 + N[(y * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -8.8e+30], N[Not[LessEqual[z, 5.1e+20]], $MachinePrecision]], t$95$0, N[(t$95$1 + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{+108}:\\
\;\;\;\;t_1 + y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{+30} \lor \neg \left(z \leq 5.1 \cdot 10^{+20}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -5.19999999999999978e154 or -2.25e108 < z < -8.7999999999999999e30 or 5.1e20 < z Initial program 88.5%
Taylor expanded in z around inf 88.6%
associate-/l*89.4%
unpow289.4%
Simplified89.4%
Taylor expanded in x around 0 82.5%
if -5.19999999999999978e154 < z < -2.25e108Initial program 79.0%
Taylor expanded in y around inf 71.5%
associate-/l*92.5%
unpow292.5%
Simplified92.5%
div-inv92.5%
clear-num92.5%
associate-/l*92.5%
Applied egg-rr92.5%
associate-/r/92.5%
Simplified92.5%
if -8.7999999999999999e30 < z < 5.1e20Initial program 99.4%
Taylor expanded in z around 0 92.6%
Final simplification88.8%
(FPCore (x y z)
:precision binary64
(if (<= x 2.4e+176)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (* x (+ (log x) -1.0))))
(+ (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)) (* z (/ z (/ x y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.4e+176) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (x * (log(x) + -1.0)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z / (x / y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.4d+176) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + (x * (log(x) + (-1.0d0))))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (z * (z / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2.4e+176) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (x * (Math.log(x) + -1.0)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (z * (z / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.4e+176: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (x * (math.log(x) + -1.0))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (z * (z / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.4e+176) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.4e+176) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (x * (log(x) + -1.0))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.4e+176], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{+176}:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \frac{z}{\frac{x}{y}}\\
\end{array}
\end{array}
if x < 2.4000000000000001e176Initial program 98.2%
Taylor expanded in x around inf 96.5%
*-commutative51.0%
sub-neg51.0%
mul-1-neg51.0%
log-rec51.0%
remove-double-neg51.0%
metadata-eval51.0%
Simplified96.5%
if 2.4000000000000001e176 < x Initial program 81.9%
Taylor expanded in z around inf 81.9%
+-commutative81.9%
fma-def81.9%
associate-/l*87.9%
+-commutative87.9%
associate-/r/87.9%
unpow287.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in z around inf 87.9%
unpow287.9%
*-commutative87.9%
associate-*l*99.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 90.9%
*-commutative90.9%
associate-/l*93.7%
Simplified93.7%
Final simplification95.8%
(FPCore (x y z)
:precision binary64
(if (<= x 0.0075)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ 0.91893853320467 (* -0.5 (log x))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* z (* z (+ (/ y x) (/ 0.0007936500793651 x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.0075) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * log(x)));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.0075d0) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (z * (z * ((y / x) + (0.0007936500793651d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.0075) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * Math.log(x)));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.0075: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * math.log(x))) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.0075) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(0.91893853320467 + Float64(-0.5 * log(x)))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.0075) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (0.91893853320467 + (-0.5 * log(x))); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.0075], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0075:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\
\end{array}
\end{array}
if x < 0.0074999999999999997Initial program 99.7%
Taylor expanded in x around 0 99.1%
if 0.0074999999999999997 < x Initial program 89.7%
Taylor expanded in z around inf 89.1%
+-commutative89.1%
fma-def89.1%
associate-/l*91.7%
+-commutative91.7%
associate-/r/91.8%
unpow291.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 91.7%
unpow291.7%
*-commutative91.7%
associate-*l*98.9%
associate-*r/98.9%
metadata-eval98.9%
Simplified98.9%
Final simplification99.0%
(FPCore (x y z)
:precision binary64
(if (or (<= z -2.85e+28) (not (<= z 5.4e+21)))
(+
(+ 0.91893853320467 (* -0.5 (log x)))
(/ (* z z) (/ x (+ y 0.0007936500793651))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.85e+28) || !(z <= 5.4e+21)) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651)));
} 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 <= (-2.85d+28)) .or. (.not. (z <= 5.4d+21))) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + ((z * z) / (x / (y + 0.0007936500793651d0)))
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 <= -2.85e+28) || !(z <= 5.4e+21)) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + ((z * z) / (x / (y + 0.0007936500793651)));
} 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 <= -2.85e+28) or not (z <= 5.4e+21): tmp = (0.91893853320467 + (-0.5 * math.log(x))) + ((z * z) / (x / (y + 0.0007936500793651))) 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 <= -2.85e+28) || !(z <= 5.4e+21)) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(Float64(z * z) / Float64(x / Float64(y + 0.0007936500793651)))); 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 <= -2.85e+28) || ~((z <= 5.4e+21))) tmp = (0.91893853320467 + (-0.5 * log(x))) + ((z * z) / (x / (y + 0.0007936500793651))); 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, -2.85e+28], N[Not[LessEqual[z, 5.4e+21]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(x / N[(y + 0.0007936500793651), $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 -2.85 \cdot 10^{+28} \lor \neg \left(z \leq 5.4 \cdot 10^{+21}\right):\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\
\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 < -2.8500000000000001e28 or 5.4e21 < z Initial program 87.3%
Taylor expanded in z around inf 87.4%
associate-/l*90.8%
unpow290.8%
Simplified90.8%
Taylor expanded in x around 0 78.8%
if -2.8500000000000001e28 < z < 5.4e21Initial program 99.4%
Taylor expanded in z around 0 92.6%
Final simplification86.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.3e+133) (not (<= z 6.6e+23))) (+ (+ 0.91893853320467 (* -0.5 (log x))) (/ y (/ x (* z z)))) (+ (+ 0.91893853320467 (* x (+ (log x) -1.0))) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.3e+133) || !(z <= 6.6e+23)) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + (y / (x / (z * z)));
} else {
tmp = (0.91893853320467 + (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.3d+133)) .or. (.not. (z <= 6.6d+23))) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + (y / (x / (z * z)))
else
tmp = (0.91893853320467d0 + (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.3e+133) || !(z <= 6.6e+23)) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + (y / (x / (z * z)));
} else {
tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.3e+133) or not (z <= 6.6e+23): tmp = (0.91893853320467 + (-0.5 * math.log(x))) + (y / (x / (z * z))) else: tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.3e+133) || !(z <= 6.6e+23)) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(y / Float64(x / Float64(z * z)))); else tmp = Float64(Float64(0.91893853320467 + 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.3e+133) || ~((z <= 6.6e+23))) tmp = (0.91893853320467 + (-0.5 * log(x))) + (y / (x / (z * z))); else tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.3e+133], N[Not[LessEqual[z, 6.6e+23]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+133} \lor \neg \left(z \leq 6.6 \cdot 10^{+23}\right):\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -1.2999999999999999e133 or 6.60000000000000059e23 < z Initial program 86.7%
Taylor expanded in y around inf 61.9%
associate-/l*66.0%
unpow266.0%
Simplified66.0%
Taylor expanded in x around 0 60.3%
Taylor expanded in x around 0 60.4%
if -1.2999999999999999e133 < z < 6.60000000000000059e23Initial program 98.3%
Taylor expanded in z around 0 86.1%
Taylor expanded in x around inf 84.2%
*-commutative84.2%
sub-neg84.2%
mul-1-neg84.2%
log-rec84.2%
remove-double-neg84.2%
metadata-eval84.2%
Simplified84.2%
Final simplification75.8%
(FPCore (x y z)
:precision binary64
(if (or (<= z -7.2e+132) (not (<= z 7.3e+22)))
(+ (+ 0.91893853320467 (* -0.5 (log x))) (/ y (/ x (* z z))))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.2e+132) || !(z <= 7.3e+22)) {
tmp = (0.91893853320467 + (-0.5 * log(x))) + (y / (x / (z * z)));
} 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 <= (-7.2d+132)) .or. (.not. (z <= 7.3d+22))) then
tmp = (0.91893853320467d0 + ((-0.5d0) * log(x))) + (y / (x / (z * z)))
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 <= -7.2e+132) || !(z <= 7.3e+22)) {
tmp = (0.91893853320467 + (-0.5 * Math.log(x))) + (y / (x / (z * z)));
} 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 <= -7.2e+132) or not (z <= 7.3e+22): tmp = (0.91893853320467 + (-0.5 * math.log(x))) + (y / (x / (z * z))) 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 <= -7.2e+132) || !(z <= 7.3e+22)) tmp = Float64(Float64(0.91893853320467 + Float64(-0.5 * log(x))) + Float64(y / Float64(x / Float64(z * z)))); 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 <= -7.2e+132) || ~((z <= 7.3e+22))) tmp = (0.91893853320467 + (-0.5 * log(x))) + (y / (x / (z * z))); 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, -7.2e+132], N[Not[LessEqual[z, 7.3e+22]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(x / N[(z * z), $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 -7.2 \cdot 10^{+132} \lor \neg \left(z \leq 7.3 \cdot 10^{+22}\right):\\
\;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{y}{\frac{x}{z \cdot z}}\\
\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 < -7.20000000000000031e132 or 7.29999999999999979e22 < z Initial program 86.7%
Taylor expanded in y around inf 61.9%
associate-/l*66.0%
unpow266.0%
Simplified66.0%
Taylor expanded in x around 0 60.3%
Taylor expanded in x around 0 60.4%
if -7.20000000000000031e132 < z < 7.29999999999999979e22Initial program 98.3%
Taylor expanded in z around 0 86.1%
Final simplification77.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -7.5e+132) (not (<= z 4.1e+23))) (- (/ y (/ x (* z z))) x) (+ (+ 0.91893853320467 (* x (+ (log x) -1.0))) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.5e+132) || !(z <= 4.1e+23)) {
tmp = (y / (x / (z * z))) - x;
} else {
tmp = (0.91893853320467 + (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 <= (-7.5d+132)) .or. (.not. (z <= 4.1d+23))) then
tmp = (y / (x / (z * z))) - x
else
tmp = (0.91893853320467d0 + (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 <= -7.5e+132) || !(z <= 4.1e+23)) {
tmp = (y / (x / (z * z))) - x;
} else {
tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + (0.083333333333333 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.5e+132) or not (z <= 4.1e+23): tmp = (y / (x / (z * z))) - x else: tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + (0.083333333333333 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.5e+132) || !(z <= 4.1e+23)) tmp = Float64(Float64(y / Float64(x / Float64(z * z))) - x); else tmp = Float64(Float64(0.91893853320467 + 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 <= -7.5e+132) || ~((z <= 4.1e+23))) tmp = (y / (x / (z * z))) - x; else tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (0.083333333333333 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.5e+132], N[Not[LessEqual[z, 4.1e+23]], $MachinePrecision]], N[(N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+132} \lor \neg \left(z \leq 4.1 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{y}{\frac{x}{z \cdot z}} - x\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -7.50000000000000017e132 or 4.09999999999999996e23 < z Initial program 86.7%
Taylor expanded in y around inf 61.9%
associate-/l*66.0%
unpow266.0%
Simplified66.0%
Taylor expanded in x around 0 60.3%
Taylor expanded in x around inf 60.3%
mul-1-neg60.3%
Simplified60.3%
if -7.50000000000000017e132 < z < 4.09999999999999996e23Initial program 98.3%
Taylor expanded in z around 0 86.1%
Taylor expanded in x around inf 84.2%
*-commutative84.2%
sub-neg84.2%
mul-1-neg84.2%
log-rec84.2%
remove-double-neg84.2%
metadata-eval84.2%
Simplified84.2%
Final simplification75.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.85e-18) (not (<= z 4.8e-19))) (- (/ y (/ x (* z z))) x) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.85e-18) || !(z <= 4.8e-19)) {
tmp = (y / (x / (z * z))) - 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.85d-18)) .or. (.not. (z <= 4.8d-19))) then
tmp = (y / (x / (z * z))) - 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.85e-18) || !(z <= 4.8e-19)) {
tmp = (y / (x / (z * z))) - x;
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.85e-18) or not (z <= 4.8e-19): tmp = (y / (x / (z * z))) - x else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.85e-18) || !(z <= 4.8e-19)) tmp = Float64(Float64(y / Float64(x / Float64(z * z))) - x); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.85e-18) || ~((z <= 4.8e-19))) tmp = (y / (x / (z * z))) - x; else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.85e-18], N[Not[LessEqual[z, 4.8e-19]], $MachinePrecision]], N[(N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{-18} \lor \neg \left(z \leq 4.8 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{y}{\frac{x}{z \cdot z}} - x\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.84999999999999986e-18 or 4.80000000000000046e-19 < z Initial program 89.2%
Taylor expanded in y around inf 64.3%
associate-/l*68.6%
unpow268.6%
Simplified68.6%
Taylor expanded in x around 0 48.2%
Taylor expanded in x around inf 48.2%
mul-1-neg48.2%
Simplified48.2%
if -2.84999999999999986e-18 < z < 4.80000000000000046e-19Initial program 99.5%
Taylor expanded in z around 0 96.4%
Taylor expanded in x around 0 46.0%
Taylor expanded in x around 0 46.2%
Final simplification47.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%
Taylor expanded in z around 0 60.7%
Taylor expanded in x around 0 23.8%
Taylor expanded in x around 0 24.2%
Final simplification24.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 2023171
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))