
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= x 3.9e-49)
(-
(+
0.91893853320467
(+
(/ 0.083333333333333 x)
(* (fma z (+ 0.0007936500793651 y) -0.0027777777777778) (/ z x))))
x)
(+
(fma (+ x -0.5) (log x) (- (- x) -0.91893853320467))
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.9e-49) {
tmp = (0.91893853320467 + ((0.083333333333333 / x) + (fma(z, (0.0007936500793651 + y), -0.0027777777777778) * (z / x)))) - x;
} else {
tmp = fma((x + -0.5), log(x), (-x - -0.91893853320467)) + ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 3.9e-49) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(0.083333333333333 / x) + Float64(fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778) * Float64(z / x)))) - x); else tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(Float64(-x) - -0.91893853320467)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 3.9e-49], N[(N[(0.91893853320467 + N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[((-x) - -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.9 \cdot 10^{-49}:\\
\;\;\;\;\left(0.91893853320467 + \left(\frac{0.083333333333333}{x} + \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right) \cdot \frac{z}{x}\right)\right) - x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, \left(-x\right) - -0.91893853320467\right) + \left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 3.90000000000000011e-49Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 85.9%
Simplified86.0%
Taylor expanded in x around 0 96.9%
Taylor expanded in x around 0 99.7%
*-commutative99.7%
associate-/l*99.8%
fma-neg99.8%
metadata-eval99.8%
Simplified99.8%
if 3.90000000000000011e-49 < x Initial program 88.6%
associate-+l-88.6%
sub-neg88.6%
metadata-eval88.6%
fma-neg88.7%
sub-neg88.7%
metadata-eval88.7%
Applied egg-rr88.7%
Taylor expanded in z around 0 99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 2.55e+70)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
(+
(*
z
(+
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x)))
(* x (+ (log x) -1.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.55e+70) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (x * (log(x) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 2.55d+70) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = ((z * ((z * ((0.0007936500793651d0 * (1.0d0 / x)) + (y / x))) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + (0.083333333333333d0 * (1.0d0 / x))) + (x * (log(x) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2.55e+70) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (x * (Math.log(x) + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.55e+70: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (x * (math.log(x) + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.55e+70) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x))) + Float64(x * Float64(log(x) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.55e+70) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = ((z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) + (x * (log(x) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.55e+70], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.55 \cdot 10^{+70}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) + x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 2.55000000000000007e70Initial program 99.7%
if 2.55000000000000007e70 < x Initial program 82.1%
associate-+l-82.1%
sub-neg82.1%
metadata-eval82.1%
fma-neg82.1%
sub-neg82.1%
metadata-eval82.1%
Applied egg-rr82.1%
Taylor expanded in x around inf 82.1%
sub-neg82.1%
mul-1-neg82.1%
log-rec82.1%
remove-double-neg82.1%
metadata-eval82.1%
Simplified82.1%
Taylor expanded in z around 0 99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ 0.0007936500793651 y)))
(t_1 (* z (- t_0 0.0027777777777778))))
(if (<= t_1 5e+278)
(+
(/ (+ 0.083333333333333 t_1) x)
(+ 0.91893853320467 (- (* x (log x)) x)))
(+
(* 0.083333333333333 (/ 1.0 x))
(* z (+ (/ t_0 x) (* 0.0027777777777778 (/ -1.0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * (0.0007936500793651 + y);
double t_1 = z * (t_0 - 0.0027777777777778);
double tmp;
if (t_1 <= 5e+278) {
tmp = ((0.083333333333333 + t_1) / x) + (0.91893853320467 + ((x * log(x)) - x));
} else {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z * (0.0007936500793651d0 + y)
t_1 = z * (t_0 - 0.0027777777777778d0)
if (t_1 <= 5d+278) then
tmp = ((0.083333333333333d0 + t_1) / x) + (0.91893853320467d0 + ((x * log(x)) - x))
else
tmp = (0.083333333333333d0 * (1.0d0 / x)) + (z * ((t_0 / x) + (0.0027777777777778d0 * ((-1.0d0) / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (0.0007936500793651 + y);
double t_1 = z * (t_0 - 0.0027777777777778);
double tmp;
if (t_1 <= 5e+278) {
tmp = ((0.083333333333333 + t_1) / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
} else {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x))));
}
return tmp;
}
def code(x, y, z): t_0 = z * (0.0007936500793651 + y) t_1 = z * (t_0 - 0.0027777777777778) tmp = 0 if t_1 <= 5e+278: tmp = ((0.083333333333333 + t_1) / x) + (0.91893853320467 + ((x * math.log(x)) - x)) else: tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x)))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(0.0007936500793651 + y)) t_1 = Float64(z * Float64(t_0 - 0.0027777777777778)) tmp = 0.0 if (t_1 <= 5e+278) tmp = Float64(Float64(Float64(0.083333333333333 + t_1) / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); else tmp = Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(t_0 / x) + Float64(0.0027777777777778 * Float64(-1.0 / x))))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (0.0007936500793651 + y); t_1 = z * (t_0 - 0.0027777777777778); tmp = 0.0; if (t_1 <= 5e+278) tmp = ((0.083333333333333 + t_1) / x) + (0.91893853320467 + ((x * log(x)) - x)); else tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+278], N[(N[(N[(0.083333333333333 + t$95$1), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(t$95$0 / x), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(0.0007936500793651 + y\right)\\
t_1 := z \cdot \left(t\_0 - 0.0027777777777778\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;\frac{0.083333333333333 + t\_1}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\frac{t\_0}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.00000000000000029e278Initial program 98.1%
Taylor expanded in x around inf 97.1%
mul-1-neg97.1%
distribute-rgt-neg-in97.1%
log-rec97.1%
remove-double-neg97.1%
Simplified97.1%
if 5.00000000000000029e278 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 74.3%
associate-+l+74.3%
fma-neg74.3%
sub-neg74.3%
metadata-eval74.3%
fma-define74.3%
fma-neg74.3%
metadata-eval74.3%
Simplified74.3%
Taylor expanded in x around 0 74.3%
Taylor expanded in z around 0 89.0%
Taylor expanded in x around 0 89.1%
Final simplification95.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= z -4.5e+50)
(+
(* 0.083333333333333 (/ 1.0 x))
(*
z
(-
(* z (+ (* 0.0007936500793651 (/ 1.0 x)) (/ y x)))
(/ 0.0027777777777778 x))))
(if (<= z 6.2e+38)
(+ t_0 (/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x))
(if (<= z 3.1e+132)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x))
(* z (* (+ 0.0007936500793651 y) (/ z x))))))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (z <= -4.5e+50) {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) - (0.0027777777777778 / x)));
} else if (z <= 6.2e+38) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x);
} else if (z <= 3.1e+132) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
} else {
tmp = z * ((0.0007936500793651 + y) * (z / 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 (z <= (-4.5d+50)) then
tmp = (0.083333333333333d0 * (1.0d0 / x)) + (z * ((z * ((0.0007936500793651d0 * (1.0d0 / x)) + (y / x))) - (0.0027777777777778d0 / x)))
else if (z <= 6.2d+38) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x)
else if (z <= 3.1d+132) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x)
else
tmp = z * ((0.0007936500793651d0 + y) * (z / 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 (z <= -4.5e+50) {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) - (0.0027777777777778 / x)));
} else if (z <= 6.2e+38) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x);
} else if (z <= 3.1e+132) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
} else {
tmp = z * ((0.0007936500793651 + y) * (z / x));
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if z <= -4.5e+50: tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) - (0.0027777777777778 / x))) elif z <= 6.2e+38: tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x) elif z <= 3.1e+132: tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) else: tmp = z * ((0.0007936500793651 + y) * (z / x)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (z <= -4.5e+50) tmp = Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(z * Float64(Float64(0.0007936500793651 * Float64(1.0 / x)) + Float64(y / x))) - Float64(0.0027777777777778 / x)))); elseif (z <= 6.2e+38) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x)); elseif (z <= 3.1e+132) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x)); else tmp = Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (z <= -4.5e+50) tmp = (0.083333333333333 * (1.0 / x)) + (z * ((z * ((0.0007936500793651 * (1.0 / x)) + (y / x))) - (0.0027777777777778 / x))); elseif (z <= 6.2e+38) tmp = t_0 + ((0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x); elseif (z <= 3.1e+132) tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x); else tmp = z * ((0.0007936500793651 + y) * (z / 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[z, -4.5e+50], N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(N[(0.0007936500793651 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+38], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+132], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+50}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - \frac{0.0027777777777778}{x}\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+38}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+132}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if z < -4.50000000000000014e50Initial program 84.8%
associate-+l+84.8%
fma-neg84.8%
sub-neg84.8%
metadata-eval84.8%
fma-define84.8%
fma-neg84.8%
metadata-eval84.8%
Simplified84.8%
Taylor expanded in x around 0 79.2%
Taylor expanded in z around 0 88.8%
Taylor expanded in x around 0 88.8%
if -4.50000000000000014e50 < z < 6.20000000000000035e38Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
metadata-eval99.6%
fma-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in x around inf 98.1%
sub-neg98.1%
mul-1-neg98.1%
log-rec98.1%
remove-double-neg98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in y around inf 96.7%
*-commutative96.7%
Simplified96.7%
if 6.20000000000000035e38 < z < 3.0999999999999998e132Initial program 83.5%
associate-+l-83.5%
sub-neg83.5%
metadata-eval83.5%
fma-neg83.7%
sub-neg83.7%
metadata-eval83.7%
Applied egg-rr83.7%
Taylor expanded in x around inf 83.7%
sub-neg83.7%
mul-1-neg83.7%
log-rec83.7%
remove-double-neg83.7%
metadata-eval83.7%
Simplified83.7%
Taylor expanded in y around 0 92.6%
if 3.0999999999999998e132 < z Initial program 81.4%
associate-+l+81.4%
fma-neg81.4%
sub-neg81.4%
metadata-eval81.4%
fma-define81.4%
fma-neg81.4%
metadata-eval81.4%
Simplified81.4%
Taylor expanded in z around 0 99.8%
Simplified99.9%
Taylor expanded in z around inf 81.4%
*-commutative81.4%
associate-*r/81.4%
metadata-eval81.4%
unpow281.4%
associate-*r*89.7%
*-commutative89.7%
distribute-rgt-in85.5%
associate-*l/85.5%
associate-*r/85.5%
associate-*l/85.5%
associate-/l*77.2%
distribute-rgt-out89.7%
Simplified89.7%
Final simplification93.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ 0.0007936500793651 y)))
(t_1 (* z (- t_0 0.0027777777777778))))
(if (<= t_1 5e+278)
(+ (/ (+ 0.083333333333333 t_1) x) (* x (+ (log x) -1.0)))
(+
(* 0.083333333333333 (/ 1.0 x))
(* z (+ (/ t_0 x) (* 0.0027777777777778 (/ -1.0 x))))))))
double code(double x, double y, double z) {
double t_0 = z * (0.0007936500793651 + y);
double t_1 = z * (t_0 - 0.0027777777777778);
double tmp;
if (t_1 <= 5e+278) {
tmp = ((0.083333333333333 + t_1) / x) + (x * (log(x) + -1.0));
} else {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = z * (0.0007936500793651d0 + y)
t_1 = z * (t_0 - 0.0027777777777778d0)
if (t_1 <= 5d+278) then
tmp = ((0.083333333333333d0 + t_1) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.083333333333333d0 * (1.0d0 / x)) + (z * ((t_0 / x) + (0.0027777777777778d0 * ((-1.0d0) / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (0.0007936500793651 + y);
double t_1 = z * (t_0 - 0.0027777777777778);
double tmp;
if (t_1 <= 5e+278) {
tmp = ((0.083333333333333 + t_1) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x))));
}
return tmp;
}
def code(x, y, z): t_0 = z * (0.0007936500793651 + y) t_1 = z * (t_0 - 0.0027777777777778) tmp = 0 if t_1 <= 5e+278: tmp = ((0.083333333333333 + t_1) / x) + (x * (math.log(x) + -1.0)) else: tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x)))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(0.0007936500793651 + y)) t_1 = Float64(z * Float64(t_0 - 0.0027777777777778)) tmp = 0.0 if (t_1 <= 5e+278) tmp = Float64(Float64(Float64(0.083333333333333 + t_1) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(t_0 / x) + Float64(0.0027777777777778 * Float64(-1.0 / x))))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (0.0007936500793651 + y); t_1 = z * (t_0 - 0.0027777777777778); tmp = 0.0; if (t_1 <= 5e+278) tmp = ((0.083333333333333 + t_1) / x) + (x * (log(x) + -1.0)); else tmp = (0.083333333333333 * (1.0 / x)) + (z * ((t_0 / x) + (0.0027777777777778 * (-1.0 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(t$95$0 - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+278], N[(N[(N[(0.083333333333333 + t$95$1), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(t$95$0 / x), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(0.0007936500793651 + y\right)\\
t_1 := z \cdot \left(t\_0 - 0.0027777777777778\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;\frac{0.083333333333333 + t\_1}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\frac{t\_0}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5.00000000000000029e278Initial program 98.1%
associate-+l-98.1%
sub-neg98.1%
metadata-eval98.1%
fma-neg98.1%
sub-neg98.1%
metadata-eval98.1%
Applied egg-rr98.1%
Taylor expanded in x around inf 97.1%
sub-neg97.1%
mul-1-neg97.1%
log-rec97.1%
remove-double-neg97.1%
metadata-eval97.1%
Simplified97.1%
if 5.00000000000000029e278 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 74.3%
associate-+l+74.3%
fma-neg74.3%
sub-neg74.3%
metadata-eval74.3%
fma-define74.3%
fma-neg74.3%
metadata-eval74.3%
Simplified74.3%
Taylor expanded in x around 0 74.3%
Taylor expanded in z around 0 89.0%
Taylor expanded in x around 0 89.1%
Final simplification95.3%
(FPCore (x y z)
:precision binary64
(if (<= x 6.5e+145)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x))
(+
(* x (+ (log x) -1.0))
(+
(* 0.083333333333333 (/ 1.0 x))
(* z (- (* z (/ 0.0007936500793651 x)) (/ 0.0027777777777778 x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.5e+145) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 6.5d+145) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 * (1.0d0 / x)) + (z * ((z * (0.0007936500793651d0 / x)) - (0.0027777777777778d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 6.5e+145) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 6.5e+145: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) else: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 6.5e+145) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 / x)) - Float64(0.0027777777777778 / x))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 6.5e+145) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6.5e+145], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.5 \cdot 10^{+145}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(z \cdot \frac{0.0007936500793651}{x} - \frac{0.0027777777777778}{x}\right)\right)\\
\end{array}
\end{array}
if x < 6.50000000000000034e145Initial program 98.2%
if 6.50000000000000034e145 < x Initial program 77.2%
associate-+l-77.2%
sub-neg77.2%
metadata-eval77.2%
fma-neg77.2%
sub-neg77.2%
metadata-eval77.2%
Applied egg-rr77.2%
Taylor expanded in x around inf 77.2%
sub-neg77.2%
mul-1-neg77.2%
log-rec77.2%
remove-double-neg77.2%
metadata-eval77.2%
Simplified77.2%
Taylor expanded in z around 0 99.7%
Taylor expanded in y around 0 90.6%
associate-*r/90.6%
associate-*l/90.6%
*-commutative90.6%
associate-*r/90.6%
metadata-eval90.6%
Simplified90.6%
Final simplification96.3%
(FPCore (x y z)
:precision binary64
(if (<= x 7.2e+145)
(+
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(+ 0.91893853320467 (- (* x (log x)) x)))
(+
(* x (+ (log x) -1.0))
(+
(* 0.083333333333333 (/ 1.0 x))
(* z (- (* z (/ 0.0007936500793651 x)) (/ 0.0027777777777778 x)))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 7.2e+145) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * log(x)) - x));
} else {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 7.2d+145) then
tmp = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x) + (0.91893853320467d0 + ((x * log(x)) - x))
else
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 * (1.0d0 / x)) + (z * ((z * (0.0007936500793651d0 / x)) - (0.0027777777777778d0 / x))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 7.2e+145) {
tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * Math.log(x)) - x));
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 7.2e+145: tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * math.log(x)) - x)) else: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x)))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 7.2e+145) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x))); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 / x)) - Float64(0.0027777777777778 / x))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 7.2e+145) tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x) + (0.91893853320467 + ((x * log(x)) - x)); else tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 * (1.0 / x)) + (z * ((z * (0.0007936500793651 / x)) - (0.0027777777777778 / x)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 7.2e+145], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z * N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] - N[(0.0027777777777778 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.2 \cdot 10^{+145}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(z \cdot \frac{0.0007936500793651}{x} - \frac{0.0027777777777778}{x}\right)\right)\\
\end{array}
\end{array}
if x < 7.19999999999999948e145Initial program 98.2%
Taylor expanded in x around inf 97.2%
mul-1-neg97.2%
distribute-rgt-neg-in97.2%
log-rec97.2%
remove-double-neg97.2%
Simplified97.2%
if 7.19999999999999948e145 < x Initial program 77.2%
associate-+l-77.2%
sub-neg77.2%
metadata-eval77.2%
fma-neg77.2%
sub-neg77.2%
metadata-eval77.2%
Applied egg-rr77.2%
Taylor expanded in x around inf 77.2%
sub-neg77.2%
mul-1-neg77.2%
log-rec77.2%
remove-double-neg77.2%
metadata-eval77.2%
Simplified77.2%
Taylor expanded in z around 0 99.7%
Taylor expanded in y around 0 90.6%
associate-*r/90.6%
associate-*l/90.6%
*-commutative90.6%
associate-*r/90.6%
metadata-eval90.6%
Simplified90.6%
Final simplification95.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ (log x) -1.0))))
(if (<= x 33000.0)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(if (<= x 5.8e+271)
(+
t_0
(/
(+
0.083333333333333
(* z (- (* z 0.0007936500793651) 0.0027777777777778)))
x))
t_0))))
double code(double x, double y, double z) {
double t_0 = x * (log(x) + -1.0);
double tmp;
if (x <= 33000.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else if (x <= 5.8e+271) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / 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 = x * (log(x) + (-1.0d0))
if (x <= 33000.0d0) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else if (x <= 5.8d+271) then
tmp = t_0 + ((0.083333333333333d0 + (z * ((z * 0.0007936500793651d0) - 0.0027777777777778d0))) / x)
else
tmp = t_0
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 <= 33000.0) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else if (x <= 5.8e+271) {
tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (math.log(x) + -1.0) tmp = 0 if x <= 33000.0: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x elif x <= 5.8e+271: tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(log(x) + -1.0)) tmp = 0.0 if (x <= 33000.0) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); elseif (x <= 5.8e+271) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * 0.0007936500793651) - 0.0027777777777778))) / x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (log(x) + -1.0); tmp = 0.0; if (x <= 33000.0) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; elseif (x <= 5.8e+271) tmp = t_0 + ((0.083333333333333 + (z * ((z * 0.0007936500793651) - 0.0027777777777778))) / x); else tmp = t_0; 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, 33000.0], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 5.8e+271], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 33000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+271}:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot 0.0007936500793651 - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 33000Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 98.7%
if 33000 < x < 5.79999999999999999e271Initial program 90.2%
associate-+l-90.2%
sub-neg90.2%
metadata-eval90.2%
fma-neg90.2%
sub-neg90.2%
metadata-eval90.2%
Applied egg-rr90.2%
Taylor expanded in x around inf 89.5%
sub-neg89.5%
mul-1-neg89.5%
log-rec89.5%
remove-double-neg89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in y around 0 79.2%
if 5.79999999999999999e271 < x Initial program 64.5%
associate-+l+64.5%
fma-neg64.6%
sub-neg64.6%
metadata-eval64.6%
fma-define64.6%
fma-neg64.6%
metadata-eval64.6%
Simplified64.6%
Taylor expanded in x around inf 89.7%
sub-neg89.7%
mul-1-neg89.7%
log-rec89.7%
remove-double-neg89.7%
metadata-eval89.7%
Simplified89.7%
Final simplification89.8%
(FPCore (x y z)
:precision binary64
(if (<= x 5.8e+125)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+125) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = x * (log(x) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 5.8d+125) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = x * (log(x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+125) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.8e+125: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.8e+125) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(x * Float64(log(x) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5.8e+125) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.8e+125], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.8 \cdot 10^{+125}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 5.79999999999999986e125Initial program 99.2%
associate-+l+99.2%
fma-neg99.2%
sub-neg99.2%
metadata-eval99.2%
fma-define99.2%
fma-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 85.2%
if 5.79999999999999986e125 < x Initial program 78.5%
associate-+l+78.5%
fma-neg78.5%
sub-neg78.5%
metadata-eval78.5%
fma-define78.5%
fma-neg78.5%
metadata-eval78.5%
Simplified78.5%
Taylor expanded in x around inf 77.9%
sub-neg77.9%
mul-1-neg77.9%
log-rec77.9%
remove-double-neg77.9%
metadata-eval77.9%
Simplified77.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.003) (not (<= z 10600.0))) (* z (* (+ 0.0007936500793651 y) (/ z x))) (/ (+ 0.083333333333333 (* z (- (* z y) 0.0027777777777778))) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.003) || !(z <= 10600.0)) {
tmp = z * ((0.0007936500793651 + y) * (z / x));
} else {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.003d0)) .or. (.not. (z <= 10600.0d0))) then
tmp = z * ((0.0007936500793651d0 + y) * (z / x))
else
tmp = (0.083333333333333d0 + (z * ((z * y) - 0.0027777777777778d0))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.003) || !(z <= 10600.0)) {
tmp = z * ((0.0007936500793651 + y) * (z / x));
} else {
tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.003) or not (z <= 10600.0): tmp = z * ((0.0007936500793651 + y) * (z / x)) else: tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.003) || !(z <= 10600.0)) tmp = Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x))); else tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * y) - 0.0027777777777778))) / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.003) || ~((z <= 10600.0))) tmp = z * ((0.0007936500793651 + y) * (z / x)); else tmp = (0.083333333333333 + (z * ((z * y) - 0.0027777777777778))) / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.003], N[Not[LessEqual[z, 10600.0]], $MachinePrecision]], N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.083333333333333 + N[(z * N[(N[(z * y), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.003 \lor \neg \left(z \leq 10600\right):\\
\;\;\;\;z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y - 0.0027777777777778\right)}{x}\\
\end{array}
\end{array}
if z < -0.0030000000000000001 or 10600 < z Initial program 86.6%
associate-+l+86.6%
fma-neg86.6%
sub-neg86.6%
metadata-eval86.6%
fma-define86.6%
fma-neg86.6%
metadata-eval86.6%
Simplified86.6%
Taylor expanded in z around 0 99.1%
Simplified99.1%
Taylor expanded in z around inf 69.4%
*-commutative69.4%
associate-*r/69.4%
metadata-eval69.4%
unpow269.4%
associate-*r*75.0%
*-commutative75.0%
distribute-rgt-in66.0%
associate-*l/66.0%
associate-*r/66.0%
associate-*l/66.6%
associate-/l*62.1%
distribute-rgt-out75.7%
Simplified75.7%
if -0.0030000000000000001 < z < 10600Initial program 99.5%
associate-+l+99.6%
fma-neg99.6%
sub-neg99.6%
metadata-eval99.6%
fma-define99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 56.3%
Taylor expanded in y around inf 56.3%
*-commutative56.3%
Simplified56.3%
Final simplification66.4%
(FPCore (x y z)
:precision binary64
(+
(* 0.083333333333333 (/ 1.0 x))
(*
z
(+
(/ (* z (+ 0.0007936500793651 y)) x)
(* 0.0027777777777778 (/ -1.0 x))))))
double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + (z * (((z * (0.0007936500793651 + y)) / x) + (0.0027777777777778 * (-1.0 / x))));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 * (1.0d0 / x)) + (z * (((z * (0.0007936500793651d0 + y)) / x) + (0.0027777777777778d0 * ((-1.0d0) / x))))
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 * (1.0 / x)) + (z * (((z * (0.0007936500793651 + y)) / x) + (0.0027777777777778 * (-1.0 / x))));
}
def code(x, y, z): return (0.083333333333333 * (1.0 / x)) + (z * (((z * (0.0007936500793651 + y)) / x) + (0.0027777777777778 * (-1.0 / x))))
function code(x, y, z) return Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) / x) + Float64(0.0027777777777778 * Float64(-1.0 / x))))) end
function tmp = code(x, y, z) tmp = (0.083333333333333 * (1.0 / x)) + (z * (((z * (0.0007936500793651 + y)) / x) + (0.0027777777777778 * (-1.0 / x)))); end
code[x_, y_, z_] := N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.0027777777777778 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\frac{z \cdot \left(0.0007936500793651 + y\right)}{x} + 0.0027777777777778 \cdot \frac{-1}{x}\right)
\end{array}
Initial program 92.8%
associate-+l+92.8%
fma-neg92.8%
sub-neg92.8%
metadata-eval92.8%
fma-define92.8%
fma-neg92.8%
metadata-eval92.8%
Simplified92.8%
Taylor expanded in x around 0 63.2%
Taylor expanded in z around 0 61.3%
Taylor expanded in x around 0 65.4%
Final simplification65.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -3e-27) (not (<= z 2.95e-30))) (* z (* (+ 0.0007936500793651 y) (/ z x))) (/ 1.0 (* x 12.000000000000048))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3e-27) || !(z <= 2.95e-30)) {
tmp = z * ((0.0007936500793651 + y) * (z / x));
} else {
tmp = 1.0 / (x * 12.000000000000048);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-3d-27)) .or. (.not. (z <= 2.95d-30))) then
tmp = z * ((0.0007936500793651d0 + y) * (z / x))
else
tmp = 1.0d0 / (x * 12.000000000000048d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3e-27) || !(z <= 2.95e-30)) {
tmp = z * ((0.0007936500793651 + y) * (z / x));
} else {
tmp = 1.0 / (x * 12.000000000000048);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3e-27) or not (z <= 2.95e-30): tmp = z * ((0.0007936500793651 + y) * (z / x)) else: tmp = 1.0 / (x * 12.000000000000048) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3e-27) || !(z <= 2.95e-30)) tmp = Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x))); else tmp = Float64(1.0 / Float64(x * 12.000000000000048)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3e-27) || ~((z <= 2.95e-30))) tmp = z * ((0.0007936500793651 + y) * (z / x)); else tmp = 1.0 / (x * 12.000000000000048); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3e-27], N[Not[LessEqual[z, 2.95e-30]], $MachinePrecision]], N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-27} \lor \neg \left(z \leq 2.95 \cdot 10^{-30}\right):\\
\;\;\;\;z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 12.000000000000048}\\
\end{array}
\end{array}
if z < -3.0000000000000001e-27 or 2.9499999999999999e-30 < z Initial program 87.6%
associate-+l+87.6%
fma-neg87.6%
sub-neg87.6%
metadata-eval87.6%
fma-define87.6%
fma-neg87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in z around 0 99.1%
Simplified99.1%
Taylor expanded in z around inf 67.4%
*-commutative67.4%
associate-*r/67.4%
metadata-eval67.4%
unpow267.4%
associate-*r*72.5%
*-commutative72.5%
distribute-rgt-in64.2%
associate-*l/64.2%
associate-*r/64.2%
associate-*l/64.8%
associate-/l*60.7%
distribute-rgt-out73.2%
Simplified73.2%
if -3.0000000000000001e-27 < z < 2.9499999999999999e-30Initial program 99.5%
associate-+l+99.5%
fma-neg99.6%
sub-neg99.6%
metadata-eval99.6%
fma-define99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 56.0%
Taylor expanded in z around 0 48.3%
add-sqr-sqrt48.1%
pow248.1%
Applied egg-rr48.1%
unpow248.1%
add-sqr-sqrt48.3%
clear-num48.3%
div-inv48.3%
metadata-eval48.3%
Applied egg-rr48.3%
Final simplification62.3%
(FPCore (x y z)
:precision binary64
(if (<= x 3.5e+115)
(/
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
x)
(* z (* (+ 0.0007936500793651 y) (/ z x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.5e+115) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = z * ((0.0007936500793651 + y) * (z / 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 <= 3.5d+115) then
tmp = (0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x
else
tmp = z * ((0.0007936500793651d0 + y) * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.5e+115) {
tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x;
} else {
tmp = z * ((0.0007936500793651 + y) * (z / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.5e+115: tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x else: tmp = z * ((0.0007936500793651 + y) * (z / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.5e+115) tmp = Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x); else tmp = Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.5e+115) tmp = (0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x; else tmp = z * ((0.0007936500793651 + y) * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.5e+115], N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.5 \cdot 10^{+115}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 3.50000000000000005e115Initial program 99.7%
associate-+l+99.7%
fma-neg99.7%
sub-neg99.7%
metadata-eval99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 85.3%
if 3.50000000000000005e115 < x Initial program 78.5%
associate-+l+78.5%
fma-neg78.5%
sub-neg78.5%
metadata-eval78.5%
fma-define78.5%
fma-neg78.5%
metadata-eval78.5%
Simplified78.5%
Taylor expanded in z around 0 99.6%
Simplified99.6%
Taylor expanded in z around inf 18.0%
*-commutative18.0%
associate-*r/18.0%
metadata-eval18.0%
unpow218.0%
associate-*r*27.1%
*-commutative27.1%
distribute-rgt-in27.1%
associate-*l/27.1%
associate-*r/27.1%
associate-*l/27.1%
associate-/l*27.1%
distribute-rgt-out27.1%
Simplified27.1%
Final simplification66.4%
(FPCore (x y z) :precision binary64 (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
double code(double x, double y, double z) {
return (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x
end function
public static double code(double x, double y, double z) {
return (0.083333333333333 + (z * -0.0027777777777778)) / x;
}
def code(x, y, z): return (0.083333333333333 + (z * -0.0027777777777778)) / x
function code(x, y, z) return Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x) end
function tmp = code(x, y, z) tmp = (0.083333333333333 + (z * -0.0027777777777778)) / x; end
code[x_, y_, z_] := N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Initial program 92.8%
associate-+l+92.8%
fma-neg92.8%
sub-neg92.8%
metadata-eval92.8%
fma-define92.8%
fma-neg92.8%
metadata-eval92.8%
Simplified92.8%
Taylor expanded in x around 0 63.2%
Taylor expanded in z around 0 29.0%
*-commutative29.0%
Simplified29.0%
(FPCore (x y z) :precision binary64 (/ 1.0 (* x 12.000000000000048)))
double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 / (x * 12.000000000000048d0)
end function
public static double code(double x, double y, double z) {
return 1.0 / (x * 12.000000000000048);
}
def code(x, y, z): return 1.0 / (x * 12.000000000000048)
function code(x, y, z) return Float64(1.0 / Float64(x * 12.000000000000048)) end
function tmp = code(x, y, z) tmp = 1.0 / (x * 12.000000000000048); end
code[x_, y_, z_] := N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x \cdot 12.000000000000048}
\end{array}
Initial program 92.8%
associate-+l+92.8%
fma-neg92.8%
sub-neg92.8%
metadata-eval92.8%
fma-define92.8%
fma-neg92.8%
metadata-eval92.8%
Simplified92.8%
Taylor expanded in x around 0 63.2%
Taylor expanded in z around 0 23.6%
add-sqr-sqrt23.5%
pow223.5%
Applied egg-rr23.5%
unpow223.5%
add-sqr-sqrt23.6%
clear-num23.5%
div-inv23.6%
metadata-eval23.6%
Applied egg-rr23.6%
(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%
associate-+l+92.8%
fma-neg92.8%
sub-neg92.8%
metadata-eval92.8%
fma-define92.8%
fma-neg92.8%
metadata-eval92.8%
Simplified92.8%
Taylor expanded in x around 0 63.2%
Taylor expanded in z around 0 23.6%
(FPCore (x y z) :precision binary64 (- x))
double code(double x, double y, double z) {
return -x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = -x
end function
public static double code(double x, double y, double z) {
return -x;
}
def code(x, y, z): return -x
function code(x, y, z) return Float64(-x) end
function tmp = code(x, y, z) tmp = -x; end
code[x_, y_, z_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
Initial program 92.8%
associate-+l+92.8%
fma-neg92.8%
sub-neg92.8%
metadata-eval92.8%
fma-define92.8%
fma-neg92.8%
metadata-eval92.8%
Simplified92.8%
Taylor expanded in z around 0 55.9%
associate-*r/55.9%
metadata-eval55.9%
sub-neg55.9%
metadata-eval55.9%
+-commutative55.9%
Simplified55.9%
Taylor expanded in x around 0 22.7%
Taylor expanded in x around inf 1.3%
neg-mul-11.3%
Simplified1.3%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024147
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))