
(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
(if (<= x 5e+29)
(+
(- 0.91893853320467 (+ x (* (log x) (- 0.5 x))))
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x))
(+
(* x (+ (log x) -1.0))
(+
(*
z
(+
(* z (- (/ y x) (* 0.0007936500793651 (/ -1.0 x))))
(* 0.0027777777777778 (/ -1.0 x))))
(* 0.083333333333333 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+29) {
tmp = (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (log(x) + -1.0)) + ((z * ((z * ((y / x) - (0.0007936500793651 * (-1.0 / x)))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (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) :: tmp
if (x <= 5d+29) then
tmp = (0.91893853320467d0 - (x + (log(x) * (0.5d0 - x)))) + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
else
tmp = (x * (log(x) + (-1.0d0))) + ((z * ((z * ((y / x) - (0.0007936500793651d0 * ((-1.0d0) / x)))) + (0.0027777777777778d0 * ((-1.0d0) / x)))) + (0.083333333333333d0 * (1.0d0 / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5e+29) {
tmp = (0.91893853320467 - (x + (Math.log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = (x * (Math.log(x) + -1.0)) + ((z * ((z * ((y / x) - (0.0007936500793651 * (-1.0 / x)))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e+29: tmp = (0.91893853320467 - (x + (math.log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) else: tmp = (x * (math.log(x) + -1.0)) + ((z * ((z * ((y / x) - (0.0007936500793651 * (-1.0 / x)))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e+29) tmp = Float64(Float64(0.91893853320467 - Float64(x + Float64(log(x) * Float64(0.5 - x)))) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(z * Float64(Float64(z * Float64(Float64(y / x) - Float64(0.0007936500793651 * Float64(-1.0 / x)))) + Float64(0.0027777777777778 * Float64(-1.0 / x)))) + Float64(0.083333333333333 * Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5e+29) tmp = (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x); else tmp = (x * (log(x) + -1.0)) + ((z * ((z * ((y / x) - (0.0007936500793651 * (-1.0 / x)))) + (0.0027777777777778 * (-1.0 / x)))) + (0.083333333333333 * (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e+29], N[(N[(0.91893853320467 - N[(x + N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(z * N[(N[(y / x), $MachinePrecision] - N[(0.0007936500793651 * N[(-1.0 / x), $MachinePrecision]), $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 5 \cdot 10^{+29}:\\
\;\;\;\;\left(0.91893853320467 - \left(x + \log x \cdot \left(0.5 - x\right)\right)\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(z \cdot \left(z \cdot \left(\frac{y}{x} - 0.0007936500793651 \cdot \frac{-1}{x}\right) + 0.0027777777777778 \cdot \frac{-1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < 5.0000000000000001e29Initial program 99.7%
if 5.0000000000000001e29 < x Initial program 88.1%
Taylor expanded in x around inf 88.2%
sub-neg88.2%
mul-1-neg88.2%
log-rec88.2%
remove-double-neg88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in z around 0 99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= z -2.5e+102)
(* (* z z) (/ (+ y 0.0007936500793651) x))
(if (<= z 1.4e+14)
(+
(* x (+ (log x) -1.0))
(/
(+
0.083333333333333
(* z (- (* 0.0007936500793651 z) 0.0027777777777778)))
x))
(* (* z z) (+ (/ 0.0007936500793651 x) (/ 1.0 (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+102) {
tmp = (z * z) * ((y + 0.0007936500793651) / x);
} else if (z <= 1.4e+14) {
tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (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 (z <= (-2.5d+102)) then
tmp = (z * z) * ((y + 0.0007936500793651d0) / x)
else if (z <= 1.4d+14) then
tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((0.0007936500793651d0 * z) - 0.0027777777777778d0))) / x)
else
tmp = (z * z) * ((0.0007936500793651d0 / x) + (1.0d0 / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+102) {
tmp = (z * z) * ((y + 0.0007936500793651) / x);
} else if (z <= 1.4e+14) {
tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.5e+102: tmp = (z * z) * ((y + 0.0007936500793651) / x) elif z <= 1.4e+14: tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x) else: tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.5e+102) tmp = Float64(Float64(z * z) * Float64(Float64(y + 0.0007936500793651) / x)); elseif (z <= 1.4e+14) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(0.0007936500793651 * z) - 0.0027777777777778))) / x)); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(1.0 / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.5e+102) tmp = (z * z) * ((y + 0.0007936500793651) / x); elseif (z <= 1.4e+14) tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((0.0007936500793651 * z) - 0.0027777777777778))) / x); else tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.5e+102], N[(N[(z * z), $MachinePrecision] * N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+14], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(0.0007936500793651 * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+102}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{y + 0.0007936500793651}{x}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{1}{\frac{x}{y}}\right)\\
\end{array}
\end{array}
if z < -2.5e102Initial program 86.6%
sub-neg86.6%
associate-+l+86.6%
fma-define86.6%
sub-neg86.6%
metadata-eval86.6%
+-commutative86.6%
unsub-neg86.6%
*-commutative86.6%
fma-define86.6%
fma-neg86.6%
metadata-eval86.6%
Simplified86.6%
Taylor expanded in z around inf 89.0%
associate-*r/89.0%
metadata-eval89.0%
Simplified89.0%
unpow289.0%
Applied egg-rr89.0%
Taylor expanded in x around 0 89.0%
if -2.5e102 < z < 1.4e14Initial program 98.3%
Taylor expanded in y around 0 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in x around inf 87.2%
sub-neg97.6%
mul-1-neg97.6%
log-rec97.6%
remove-double-neg97.6%
metadata-eval97.6%
Simplified87.2%
if 1.4e14 < z Initial program 88.6%
sub-neg88.6%
associate-+l+88.6%
fma-define88.6%
sub-neg88.6%
metadata-eval88.6%
+-commutative88.6%
unsub-neg88.6%
*-commutative88.6%
fma-define88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in z around inf 78.3%
associate-*r/78.4%
metadata-eval78.4%
Simplified78.4%
unpow278.4%
Applied egg-rr78.4%
clear-num78.4%
inv-pow78.4%
Applied egg-rr78.4%
unpow-178.4%
Simplified78.4%
Final simplification85.5%
(FPCore (x y z)
:precision binary64
(if (<= z -2.1e+60)
(* (- (/ y x) (* 0.0007936500793651 (/ -1.0 x))) (* z z))
(if (<= z 15200000000000.0)
(+
(- 0.91893853320467 (+ x (* (log x) (- 0.5 x))))
(/ 1.0 (* x 12.000000000000048)))
(* (* z z) (+ (/ 0.0007936500793651 x) (/ 1.0 (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.1e+60) {
tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z);
} else if (z <= 15200000000000.0) {
tmp = (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (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 (z <= (-2.1d+60)) then
tmp = ((y / x) - (0.0007936500793651d0 * ((-1.0d0) / x))) * (z * z)
else if (z <= 15200000000000.0d0) then
tmp = (0.91893853320467d0 - (x + (log(x) * (0.5d0 - x)))) + (1.0d0 / (x * 12.000000000000048d0))
else
tmp = (z * z) * ((0.0007936500793651d0 / x) + (1.0d0 / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.1e+60) {
tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z);
} else if (z <= 15200000000000.0) {
tmp = (0.91893853320467 - (x + (Math.log(x) * (0.5 - x)))) + (1.0 / (x * 12.000000000000048));
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.1e+60: tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z) elif z <= 15200000000000.0: tmp = (0.91893853320467 - (x + (math.log(x) * (0.5 - x)))) + (1.0 / (x * 12.000000000000048)) else: tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.1e+60) tmp = Float64(Float64(Float64(y / x) - Float64(0.0007936500793651 * Float64(-1.0 / x))) * Float64(z * z)); elseif (z <= 15200000000000.0) tmp = Float64(Float64(0.91893853320467 - Float64(x + Float64(log(x) * Float64(0.5 - x)))) + Float64(1.0 / Float64(x * 12.000000000000048))); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(1.0 / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.1e+60) tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z); elseif (z <= 15200000000000.0) tmp = (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (1.0 / (x * 12.000000000000048)); else tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.1e+60], N[(N[(N[(y / x), $MachinePrecision] - N[(0.0007936500793651 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 15200000000000.0], N[(N[(0.91893853320467 - N[(x + N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+60}:\\
\;\;\;\;\left(\frac{y}{x} - 0.0007936500793651 \cdot \frac{-1}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;z \leq 15200000000000:\\
\;\;\;\;\left(0.91893853320467 - \left(x + \log x \cdot \left(0.5 - x\right)\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{1}{\frac{x}{y}}\right)\\
\end{array}
\end{array}
if z < -2.1000000000000001e60Initial program 89.7%
sub-neg89.7%
associate-+l+89.7%
fma-define89.7%
sub-neg89.7%
metadata-eval89.7%
+-commutative89.7%
unsub-neg89.7%
*-commutative89.7%
fma-define89.7%
fma-neg89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in z around inf 84.5%
associate-*r/84.5%
metadata-eval84.5%
Simplified84.5%
unpow284.5%
Applied egg-rr84.5%
div-inv84.5%
Applied egg-rr84.5%
if -2.1000000000000001e60 < z < 1.52e13Initial program 98.2%
clear-num98.1%
inv-pow98.1%
*-commutative98.1%
fma-undefine98.1%
fma-neg98.1%
metadata-eval98.1%
Applied egg-rr98.1%
unpow-198.1%
fma-define98.1%
+-commutative98.1%
*-commutative98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in z around 0 88.3%
*-commutative88.3%
Simplified88.3%
if 1.52e13 < z Initial program 88.6%
sub-neg88.6%
associate-+l+88.6%
fma-define88.6%
sub-neg88.6%
metadata-eval88.6%
+-commutative88.6%
unsub-neg88.6%
*-commutative88.6%
fma-define88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in z around inf 78.3%
associate-*r/78.4%
metadata-eval78.4%
Simplified78.4%
unpow278.4%
Applied egg-rr78.4%
clear-num78.4%
inv-pow78.4%
Applied egg-rr78.4%
unpow-178.4%
Simplified78.4%
Final simplification85.2%
(FPCore (x y z)
:precision binary64
(if (<= z -2.1e+60)
(* (- (/ y x) (* 0.0007936500793651 (/ -1.0 x))) (* z z))
(if (<= z 8.8e+14)
(+
(- 0.91893853320467 (+ x (* (log x) (- 0.5 x))))
(/ 0.083333333333333 x))
(* (* z z) (+ (/ 0.0007936500793651 x) (/ 1.0 (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.1e+60) {
tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z);
} else if (z <= 8.8e+14) {
tmp = (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (0.083333333333333 / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (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 (z <= (-2.1d+60)) then
tmp = ((y / x) - (0.0007936500793651d0 * ((-1.0d0) / x))) * (z * z)
else if (z <= 8.8d+14) then
tmp = (0.91893853320467d0 - (x + (log(x) * (0.5d0 - x)))) + (0.083333333333333d0 / x)
else
tmp = (z * z) * ((0.0007936500793651d0 / x) + (1.0d0 / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.1e+60) {
tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z);
} else if (z <= 8.8e+14) {
tmp = (0.91893853320467 - (x + (Math.log(x) * (0.5 - x)))) + (0.083333333333333 / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.1e+60: tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z) elif z <= 8.8e+14: tmp = (0.91893853320467 - (x + (math.log(x) * (0.5 - x)))) + (0.083333333333333 / x) else: tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.1e+60) tmp = Float64(Float64(Float64(y / x) - Float64(0.0007936500793651 * Float64(-1.0 / x))) * Float64(z * z)); elseif (z <= 8.8e+14) tmp = Float64(Float64(0.91893853320467 - Float64(x + Float64(log(x) * Float64(0.5 - x)))) + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(1.0 / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.1e+60) tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z); elseif (z <= 8.8e+14) tmp = (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (0.083333333333333 / x); else tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.1e+60], N[(N[(N[(y / x), $MachinePrecision] - N[(0.0007936500793651 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e+14], N[(N[(0.91893853320467 - N[(x + N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+60}:\\
\;\;\;\;\left(\frac{y}{x} - 0.0007936500793651 \cdot \frac{-1}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{+14}:\\
\;\;\;\;\left(0.91893853320467 - \left(x + \log x \cdot \left(0.5 - x\right)\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{1}{\frac{x}{y}}\right)\\
\end{array}
\end{array}
if z < -2.1000000000000001e60Initial program 89.7%
sub-neg89.7%
associate-+l+89.7%
fma-define89.7%
sub-neg89.7%
metadata-eval89.7%
+-commutative89.7%
unsub-neg89.7%
*-commutative89.7%
fma-define89.7%
fma-neg89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in z around inf 84.5%
associate-*r/84.5%
metadata-eval84.5%
Simplified84.5%
unpow284.5%
Applied egg-rr84.5%
div-inv84.5%
Applied egg-rr84.5%
if -2.1000000000000001e60 < z < 8.8e14Initial program 98.2%
Taylor expanded in z around 0 88.2%
if 8.8e14 < z Initial program 88.6%
sub-neg88.6%
associate-+l+88.6%
fma-define88.6%
sub-neg88.6%
metadata-eval88.6%
+-commutative88.6%
unsub-neg88.6%
*-commutative88.6%
fma-define88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in z around inf 78.3%
associate-*r/78.4%
metadata-eval78.4%
Simplified78.4%
unpow278.4%
Applied egg-rr78.4%
clear-num78.4%
inv-pow78.4%
Applied egg-rr78.4%
unpow-178.4%
Simplified78.4%
Final simplification85.2%
(FPCore (x y z)
:precision binary64
(+
(- 0.91893853320467 (+ x (* (log x) (- 0.5 x))))
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)))
double code(double x, double y, double z) {
return (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 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.91893853320467d0 - (x + (log(x) * (0.5d0 - x)))) + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
end function
public static double code(double x, double y, double z) {
return (0.91893853320467 - (x + (Math.log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
}
def code(x, y, z): return (0.91893853320467 - (x + (math.log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)
function code(x, y, z) return Float64(Float64(0.91893853320467 - Float64(x + Float64(log(x) * Float64(0.5 - x)))) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)) end
function tmp = code(x, y, z) tmp = (0.91893853320467 - (x + (log(x) * (0.5 - x)))) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x); end
code[x_, y_, z_] := N[(N[(0.91893853320467 - N[(x + N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.91893853320467 - \left(x + \log x \cdot \left(0.5 - x\right)\right)\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}
\end{array}
Initial program 94.2%
Final simplification94.2%
(FPCore (x y z)
:precision binary64
(if (<= z -2e+60)
(* (- (/ y x) (* 0.0007936500793651 (/ -1.0 x))) (* z z))
(if (<= z 67000000000000.0)
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))
(* (* z z) (+ (/ 0.0007936500793651 x) (/ 1.0 (/ x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2e+60) {
tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z);
} else if (z <= 67000000000000.0) {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (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 (z <= (-2d+60)) then
tmp = ((y / x) - (0.0007936500793651d0 * ((-1.0d0) / x))) * (z * z)
else if (z <= 67000000000000.0d0) then
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
else
tmp = (z * z) * ((0.0007936500793651d0 / x) + (1.0d0 / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2e+60) {
tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z);
} else if (z <= 67000000000000.0) {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
} else {
tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2e+60: tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z) elif z <= 67000000000000.0: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) else: tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2e+60) tmp = Float64(Float64(Float64(y / x) - Float64(0.0007936500793651 * Float64(-1.0 / x))) * Float64(z * z)); elseif (z <= 67000000000000.0) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); else tmp = Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 / x) + Float64(1.0 / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2e+60) tmp = ((y / x) - (0.0007936500793651 * (-1.0 / x))) * (z * z); elseif (z <= 67000000000000.0) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); else tmp = (z * z) * ((0.0007936500793651 / x) + (1.0 / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2e+60], N[(N[(N[(y / x), $MachinePrecision] - N[(0.0007936500793651 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 67000000000000.0], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+60}:\\
\;\;\;\;\left(\frac{y}{x} - 0.0007936500793651 \cdot \frac{-1}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;z \leq 67000000000000:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \left(\frac{0.0007936500793651}{x} + \frac{1}{\frac{x}{y}}\right)\\
\end{array}
\end{array}
if z < -1.9999999999999999e60Initial program 89.7%
sub-neg89.7%
associate-+l+89.7%
fma-define89.7%
sub-neg89.7%
metadata-eval89.7%
+-commutative89.7%
unsub-neg89.7%
*-commutative89.7%
fma-define89.7%
fma-neg89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in z around inf 84.5%
associate-*r/84.5%
metadata-eval84.5%
Simplified84.5%
unpow284.5%
Applied egg-rr84.5%
div-inv84.5%
Applied egg-rr84.5%
if -1.9999999999999999e60 < z < 6.7e13Initial program 98.2%
Taylor expanded in x around inf 97.4%
sub-neg97.4%
mul-1-neg97.4%
log-rec97.4%
remove-double-neg97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in z around 0 87.4%
if 6.7e13 < z Initial program 88.6%
sub-neg88.6%
associate-+l+88.6%
fma-define88.6%
sub-neg88.6%
metadata-eval88.6%
+-commutative88.6%
unsub-neg88.6%
*-commutative88.6%
fma-define88.6%
fma-neg88.6%
metadata-eval88.6%
Simplified88.6%
Taylor expanded in z around inf 78.3%
associate-*r/78.4%
metadata-eval78.4%
Simplified78.4%
unpow278.4%
Applied egg-rr78.4%
clear-num78.4%
inv-pow78.4%
Applied egg-rr78.4%
unpow-178.4%
Simplified78.4%
Final simplification84.8%
(FPCore (x y z)
:precision binary64
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z): return (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (math.log(x) + -1.0))
function code(x, y, z) return Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(x * Float64(log(x) + -1.0))) end
function tmp = code(x, y, z) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0)); end
code[x_, y_, z_] := N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + x \cdot \left(\log x + -1\right)
\end{array}
Initial program 94.2%
Taylor expanded in x around inf 93.7%
sub-neg93.7%
mul-1-neg93.7%
log-rec93.7%
remove-double-neg93.7%
metadata-eval93.7%
Simplified93.7%
Final simplification93.7%
(FPCore (x y z) :precision binary64 (if (<= x 2.4e+62) (/ (* (* z z) (+ y 0.0007936500793651)) x) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.4e+62) {
tmp = ((z * z) * (y + 0.0007936500793651)) / 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 <= 2.4d+62) then
tmp = ((z * z) * (y + 0.0007936500793651d0)) / 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 <= 2.4e+62) {
tmp = ((z * z) * (y + 0.0007936500793651)) / x;
} else {
tmp = x * (Math.log(x) + -1.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.4e+62: tmp = ((z * z) * (y + 0.0007936500793651)) / x else: tmp = x * (math.log(x) + -1.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.4e+62) tmp = Float64(Float64(Float64(z * z) * Float64(y + 0.0007936500793651)) / 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 <= 2.4e+62) tmp = ((z * z) * (y + 0.0007936500793651)) / x; else tmp = x * (log(x) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.4e+62], N[(N[(N[(z * z), $MachinePrecision] * N[(y + 0.0007936500793651), $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 2.4 \cdot 10^{+62}:\\
\;\;\;\;\frac{\left(z \cdot z\right) \cdot \left(y + 0.0007936500793651\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right)\\
\end{array}
\end{array}
if x < 2.4e62Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
unsub-neg99.7%
*-commutative99.7%
fma-define99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 56.5%
associate-*r/56.6%
metadata-eval56.6%
Simplified56.6%
Taylor expanded in x around -inf 59.7%
unpow256.6%
Applied egg-rr59.7%
if 2.4e62 < x Initial program 86.0%
sub-neg86.0%
associate-+l+86.0%
fma-define86.1%
sub-neg86.1%
metadata-eval86.1%
+-commutative86.1%
unsub-neg86.1%
*-commutative86.1%
fma-define86.1%
fma-neg86.1%
metadata-eval86.1%
Simplified86.1%
Taylor expanded in z around 0 77.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%
Final simplification66.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.4e+26) (not (<= y 0.00078))) (* (/ y x) (* z z)) (* (* z z) (/ 0.0007936500793651 x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.4e+26) || !(y <= 0.00078)) {
tmp = (y / x) * (z * z);
} else {
tmp = (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) :: tmp
if ((y <= (-4.4d+26)) .or. (.not. (y <= 0.00078d0))) then
tmp = (y / x) * (z * z)
else
tmp = (z * z) * (0.0007936500793651d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.4e+26) || !(y <= 0.00078)) {
tmp = (y / x) * (z * z);
} else {
tmp = (z * z) * (0.0007936500793651 / x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.4e+26) or not (y <= 0.00078): tmp = (y / x) * (z * z) else: tmp = (z * z) * (0.0007936500793651 / x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.4e+26) || !(y <= 0.00078)) tmp = Float64(Float64(y / x) * Float64(z * z)); else tmp = Float64(Float64(z * z) * Float64(0.0007936500793651 / x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.4e+26) || ~((y <= 0.00078))) tmp = (y / x) * (z * z); else tmp = (z * z) * (0.0007936500793651 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.4e+26], N[Not[LessEqual[y, 0.00078]], $MachinePrecision]], N[(N[(y / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(z * z), $MachinePrecision] * N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+26} \lor \neg \left(y \leq 0.00078\right):\\
\;\;\;\;\frac{y}{x} \cdot \left(z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651}{x}\\
\end{array}
\end{array}
if y < -4.40000000000000014e26 or 7.79999999999999986e-4 < y Initial program 93.1%
sub-neg93.1%
associate-+l+93.1%
fma-define93.1%
sub-neg93.1%
metadata-eval93.1%
+-commutative93.1%
unsub-neg93.1%
*-commutative93.1%
fma-define93.1%
fma-neg93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in z around inf 47.0%
associate-*r/47.0%
metadata-eval47.0%
Simplified47.0%
unpow247.0%
Applied egg-rr47.0%
Taylor expanded in y around inf 47.0%
if -4.40000000000000014e26 < y < 7.79999999999999986e-4Initial program 95.3%
sub-neg95.3%
associate-+l+95.3%
fma-define95.3%
sub-neg95.3%
metadata-eval95.3%
+-commutative95.3%
unsub-neg95.3%
*-commutative95.3%
fma-define95.3%
fma-neg95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around inf 36.5%
associate-*r/36.6%
metadata-eval36.6%
Simplified36.6%
unpow236.6%
Applied egg-rr36.6%
Taylor expanded in y around 0 36.6%
Final simplification41.8%
(FPCore (x y z) :precision binary64 (/ (* (* z z) (+ y 0.0007936500793651)) x))
double code(double x, double y, double z) {
return ((z * z) * (y + 0.0007936500793651)) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((z * z) * (y + 0.0007936500793651d0)) / x
end function
public static double code(double x, double y, double z) {
return ((z * z) * (y + 0.0007936500793651)) / x;
}
def code(x, y, z): return ((z * z) * (y + 0.0007936500793651)) / x
function code(x, y, z) return Float64(Float64(Float64(z * z) * Float64(y + 0.0007936500793651)) / x) end
function tmp = code(x, y, z) tmp = ((z * z) * (y + 0.0007936500793651)) / x; end
code[x_, y_, z_] := N[(N[(N[(z * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(z \cdot z\right) \cdot \left(y + 0.0007936500793651\right)}{x}
\end{array}
Initial program 94.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.2%
sub-neg94.2%
metadata-eval94.2%
+-commutative94.2%
unsub-neg94.2%
*-commutative94.2%
fma-define94.2%
fma-neg94.2%
metadata-eval94.2%
Simplified94.2%
Taylor expanded in z around inf 41.8%
associate-*r/41.8%
metadata-eval41.8%
Simplified41.8%
Taylor expanded in x around -inf 42.3%
unpow241.8%
Applied egg-rr42.3%
Final simplification42.3%
(FPCore (x y z) :precision binary64 (* (* z z) (/ (+ y 0.0007936500793651) x)))
double code(double x, double y, double z) {
return (z * z) * ((y + 0.0007936500793651) / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (z * z) * ((y + 0.0007936500793651d0) / x)
end function
public static double code(double x, double y, double z) {
return (z * z) * ((y + 0.0007936500793651) / x);
}
def code(x, y, z): return (z * z) * ((y + 0.0007936500793651) / x)
function code(x, y, z) return Float64(Float64(z * z) * Float64(Float64(y + 0.0007936500793651) / x)) end
function tmp = code(x, y, z) tmp = (z * z) * ((y + 0.0007936500793651) / x); end
code[x_, y_, z_] := N[(N[(z * z), $MachinePrecision] * N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot z\right) \cdot \frac{y + 0.0007936500793651}{x}
\end{array}
Initial program 94.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.2%
sub-neg94.2%
metadata-eval94.2%
+-commutative94.2%
unsub-neg94.2%
*-commutative94.2%
fma-define94.2%
fma-neg94.2%
metadata-eval94.2%
Simplified94.2%
Taylor expanded in z around inf 41.8%
associate-*r/41.8%
metadata-eval41.8%
Simplified41.8%
unpow241.8%
Applied egg-rr41.8%
Taylor expanded in x around 0 41.8%
Final simplification41.8%
(FPCore (x y z) :precision binary64 (* (* z z) (/ 0.0007936500793651 x)))
double code(double x, double y, double z) {
return (z * z) * (0.0007936500793651 / x);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (z * z) * (0.0007936500793651d0 / x)
end function
public static double code(double x, double y, double z) {
return (z * z) * (0.0007936500793651 / x);
}
def code(x, y, z): return (z * z) * (0.0007936500793651 / x)
function code(x, y, z) return Float64(Float64(z * z) * Float64(0.0007936500793651 / x)) end
function tmp = code(x, y, z) tmp = (z * z) * (0.0007936500793651 / x); end
code[x_, y_, z_] := N[(N[(z * z), $MachinePrecision] * N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot z\right) \cdot \frac{0.0007936500793651}{x}
\end{array}
Initial program 94.2%
sub-neg94.2%
associate-+l+94.2%
fma-define94.2%
sub-neg94.2%
metadata-eval94.2%
+-commutative94.2%
unsub-neg94.2%
*-commutative94.2%
fma-define94.2%
fma-neg94.2%
metadata-eval94.2%
Simplified94.2%
Taylor expanded in z around inf 41.8%
associate-*r/41.8%
metadata-eval41.8%
Simplified41.8%
unpow241.8%
Applied egg-rr41.8%
Taylor expanded in y around 0 26.5%
(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 2024135
(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)))