
(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 15 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 (<= (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)) 4e+295)
(+
(fma (+ x -0.5) (log x) (- x))
(+
0.91893853320467
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(pow (* z (sqrt (/ (+ y 0.0007936500793651) x))) 2.0))))
double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) {
tmp = fma((x + -0.5), log(x), -x) + (0.91893853320467 + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + pow((z * sqrt(((y + 0.0007936500793651) / x))), 2.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(-x)) + Float64(0.91893853320467 + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + (Float64(z * sqrt(Float64(Float64(y + 0.0007936500793651) / x))) ^ 2.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 4e+295], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + N[(0.91893853320467 + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * N[Sqrt[N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 4 \cdot 10^{+295}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, -x\right) + \left(0.91893853320467 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + {\left(z \cdot \sqrt{\frac{y + 0.0007936500793651}{x}}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295Initial program 99.6%
associate-+l+99.6%
fma-neg99.6%
sub-neg99.6%
metadata-eval99.6%
*-commutative99.6%
fma-def99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 81.7%
add-sqr-sqrt81.7%
pow281.7%
*-commutative81.7%
fma-udef81.7%
fma-neg81.7%
metadata-eval81.7%
Applied egg-rr81.7%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)) 4e+295)
(+
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)
(- (fma (+ x -0.5) (log x) 0.91893853320467) x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(pow (* z (sqrt (/ (+ y 0.0007936500793651) x))) 2.0))))
double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) {
tmp = (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + (fma((x + -0.5), log(x), 0.91893853320467) - x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + pow((z * sqrt(((y + 0.0007936500793651) / x))), 2.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) tmp = Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) + Float64(fma(Float64(x + -0.5), log(x), 0.91893853320467) - x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + (Float64(z * sqrt(Float64(Float64(y + 0.0007936500793651) / x))) ^ 2.0)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 4e+295], N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * N[Sqrt[N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 4 \cdot 10^{+295}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} + \left(\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + {\left(z \cdot \sqrt{\frac{y + 0.0007936500793651}{x}}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295Initial program 99.6%
+-commutative99.6%
associate-+r-99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
*-commutative99.6%
fma-def99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 81.7%
add-sqr-sqrt81.7%
pow281.7%
*-commutative81.7%
fma-udef81.7%
fma-neg81.7%
metadata-eval81.7%
Applied egg-rr81.7%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)) 4e+295)
(+
(- (* (+ x -0.5) (log x)) x)
(+
0.91893853320467
(/
(+
0.083333333333333
(+ (* z -0.0027777777777778) (* (+ y 0.0007936500793651) (pow z 2.0))))
x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(pow (* z (sqrt (/ (+ y 0.0007936500793651) x))) 2.0))))
double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) {
tmp = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * pow(z, 2.0)))) / x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + pow((z * sqrt(((y + 0.0007936500793651) / x))), 2.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 ((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) <= 4d+295) then
tmp = (((x + (-0.5d0)) * log(x)) - x) + (0.91893853320467d0 + ((0.083333333333333d0 + ((z * (-0.0027777777777778d0)) + ((y + 0.0007936500793651d0) * (z ** 2.0d0)))) / x))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((z * sqrt(((y + 0.0007936500793651d0) / x))) ** 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) {
tmp = (((x + -0.5) * Math.log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * Math.pow(z, 2.0)))) / x));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + Math.pow((z * Math.sqrt(((y + 0.0007936500793651) / x))), 2.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295: tmp = (((x + -0.5) * math.log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * math.pow(z, 2.0)))) / x)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + math.pow((z * math.sqrt(((y + 0.0007936500793651) / x))), 2.0) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + Float64(0.91893853320467 + Float64(Float64(0.083333333333333 + Float64(Float64(z * -0.0027777777777778) + Float64(Float64(y + 0.0007936500793651) * (z ^ 2.0)))) / x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + (Float64(z * sqrt(Float64(Float64(y + 0.0007936500793651) / x))) ^ 2.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 4e+295) tmp = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * (z ^ 2.0)))) / x)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((z * sqrt(((y + 0.0007936500793651) / x))) ^ 2.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 4e+295], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(0.083333333333333 + N[(N[(z * -0.0027777777777778), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * N[Sqrt[N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 4 \cdot 10^{+295}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - x\right) + \left(0.91893853320467 + \frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot {z}^{2}\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + {\left(z \cdot \sqrt{\frac{y + 0.0007936500793651}{x}}\right)}^{2}\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295Initial program 99.6%
associate-+l+99.6%
sub-neg99.6%
sub-neg99.6%
sub-neg99.6%
metadata-eval99.6%
fma-def99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.6%
if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 81.7%
add-sqr-sqrt81.7%
pow281.7%
*-commutative81.7%
fma-udef81.7%
fma-neg81.7%
metadata-eval81.7%
Applied egg-rr81.7%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)) 2e+296)
(+
(- (* (+ x -0.5) (log x)) x)
(+
0.91893853320467
(/
(+
0.083333333333333
(+ (* z -0.0027777777777778) (* (+ y 0.0007936500793651) (pow z 2.0))))
x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (+ y 0.0007936500793651) (* z (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 2e+296) {
tmp = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * pow(z, 2.0)))) / x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (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 ((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) <= 2d+296) then
tmp = (((x + (-0.5d0)) * log(x)) - x) + (0.91893853320467d0 + ((0.083333333333333d0 + ((z * (-0.0027777777777778d0)) + ((y + 0.0007936500793651d0) * (z ** 2.0d0)))) / x))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((y + 0.0007936500793651d0) * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 2e+296) {
tmp = (((x + -0.5) * Math.log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * Math.pow(z, 2.0)))) / x));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 2e+296: tmp = (((x + -0.5) * math.log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * math.pow(z, 2.0)))) / x)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) <= 2e+296) tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + Float64(0.91893853320467 + Float64(Float64(0.083333333333333 + Float64(Float64(z * -0.0027777777777778) + Float64(Float64(y + 0.0007936500793651) * (z ^ 2.0)))) / x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) <= 2e+296) tmp = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + ((z * -0.0027777777777778) + ((y + 0.0007936500793651) * (z ^ 2.0)))) / x)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision], 2e+296], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(0.083333333333333 + N[(N[(z * -0.0027777777777778), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \leq 2 \cdot 10^{+296}:\\
\;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - x\right) + \left(0.91893853320467 + \frac{0.083333333333333 + \left(z \cdot -0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot {z}^{2}\right)}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 1.99999999999999996e296Initial program 99.6%
associate-+l+99.6%
sub-neg99.6%
sub-neg99.6%
sub-neg99.6%
metadata-eval99.6%
fma-def99.6%
fma-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.6%
if 1.99999999999999996e296 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 81.4%
Taylor expanded in z around inf 81.4%
associate-/l*87.2%
+-commutative87.2%
associate-/r/87.2%
+-commutative87.2%
Simplified87.2%
unpow287.2%
*-un-lft-identity87.2%
times-frac98.6%
Applied egg-rr98.6%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
(if (<= t_0 4e+295)
(+
(- (fma (log x) (+ x -0.5) 0.91893853320467) x)
(/ (+ t_0 0.083333333333333) x))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (+ y 0.0007936500793651) (* z (/ z x)))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778);
double tmp;
if (t_0 <= 4e+295) {
tmp = (fma(log(x), (x + -0.5), 0.91893853320467) - x) + ((t_0 + 0.083333333333333) / x);
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= 4e+295) tmp = Float64(Float64(fma(log(x), Float64(x + -0.5), 0.91893853320467) - x) + Float64(Float64(t_0 + 0.083333333333333) / x)); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e+295], N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision] + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t_0 \leq 4 \cdot 10^{+295}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467\right) - x\right) + \frac{t_0 + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295Initial program 99.6%
Taylor expanded in x around 0 99.6%
associate-+r+99.6%
sub-neg99.6%
metadata-eval99.6%
distribute-rgt-in99.6%
*-commutative99.6%
neg-mul-199.6%
associate-+l+99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
distribute-rgt-in99.6%
fma-def99.6%
sub-neg99.6%
Simplified99.6%
if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 81.7%
Taylor expanded in z around inf 81.7%
associate-/l*87.4%
+-commutative87.4%
associate-/r/87.4%
+-commutative87.4%
Simplified87.4%
unpow287.4%
*-un-lft-identity87.4%
times-frac98.6%
Applied egg-rr98.6%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(if (<= x 5800000.0)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(+ (/ (log x) (/ 1.0 (+ x -0.5))) (- 0.91893853320467 x)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (+ y 0.0007936500793651) (* z (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5800000.0) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + ((log(x) / (1.0 / (x + -0.5))) + (0.91893853320467 - x));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (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 <= 5800000.0d0) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + ((log(x) / (1.0d0 / (x + (-0.5d0)))) + (0.91893853320467d0 - x))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((y + 0.0007936500793651d0) * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5800000.0) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + ((Math.log(x) / (1.0 / (x + -0.5))) + (0.91893853320467 - x));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5800000.0: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + ((math.log(x) / (1.0 / (x + -0.5))) + (0.91893853320467 - x)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5800000.0) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(Float64(log(x) / Float64(1.0 / Float64(x + -0.5))) + Float64(0.91893853320467 - x))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5800000.0) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + ((log(x) / (1.0 / (x + -0.5))) + (0.91893853320467 - x)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5800000.0], N[(N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] / N[(1.0 / N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5800000:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(\frac{\log x}{\frac{1}{x + -0.5}} + \left(0.91893853320467 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 5.8e6Initial program 99.7%
sub-neg99.7%
metadata-eval99.7%
*-commutative99.7%
flip-+99.7%
associate-*r/99.7%
fma-neg99.7%
metadata-eval99.7%
metadata-eval99.7%
sub-neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
associate-/l*99.7%
Simplified99.7%
associate-+l-99.7%
clear-num99.7%
metadata-eval99.7%
metadata-eval99.7%
fma-neg99.7%
*-un-lft-identity99.7%
fma-def99.7%
metadata-eval99.7%
fma-neg99.7%
*-un-lft-identity99.7%
flip-+99.7%
Applied egg-rr99.7%
if 5.8e6 < x Initial program 89.4%
Taylor expanded in z around inf 89.4%
associate-/l*92.6%
+-commutative92.6%
associate-/r/92.6%
+-commutative92.6%
Simplified92.6%
unpow292.6%
*-un-lft-identity92.6%
times-frac98.9%
Applied egg-rr98.9%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(- (* (+ x -0.5) (log x)) x)
(+
0.91893853320467
(/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)))))
(if (<= z -7.6e+84)
(* y (/ (pow z 2.0) x))
(if (<= z -8.8e-18)
t_0
(if (<= z -2.15e-24)
(/ (* y (pow z 2.0)) x)
(if (<= z 1.15e+114)
t_0
(+
(/ y (* (/ 1.0 z) (/ x z)))
(+ 0.91893853320467 (* -0.5 (log x))))))))))
double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + (z * -0.0027777777777778)) / x));
double tmp;
if (z <= -7.6e+84) {
tmp = y * (pow(z, 2.0) / x);
} else if (z <= -8.8e-18) {
tmp = t_0;
} else if (z <= -2.15e-24) {
tmp = (y * pow(z, 2.0)) / x;
} else if (z <= 1.15e+114) {
tmp = t_0;
} else {
tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * log(x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x + (-0.5d0)) * log(x)) - x) + (0.91893853320467d0 + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x))
if (z <= (-7.6d+84)) then
tmp = y * ((z ** 2.0d0) / x)
else if (z <= (-8.8d-18)) then
tmp = t_0
else if (z <= (-2.15d-24)) then
tmp = (y * (z ** 2.0d0)) / x
else if (z <= 1.15d+114) then
tmp = t_0
else
tmp = (y / ((1.0d0 / z) * (x / z))) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x + -0.5) * Math.log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + (z * -0.0027777777777778)) / x));
double tmp;
if (z <= -7.6e+84) {
tmp = y * (Math.pow(z, 2.0) / x);
} else if (z <= -8.8e-18) {
tmp = t_0;
} else if (z <= -2.15e-24) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else if (z <= 1.15e+114) {
tmp = t_0;
} else {
tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * Math.log(x)));
}
return tmp;
}
def code(x, y, z): t_0 = (((x + -0.5) * math.log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + (z * -0.0027777777777778)) / x)) tmp = 0 if z <= -7.6e+84: tmp = y * (math.pow(z, 2.0) / x) elif z <= -8.8e-18: tmp = t_0 elif z <= -2.15e-24: tmp = (y * math.pow(z, 2.0)) / x elif z <= 1.15e+114: tmp = t_0 else: tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * math.log(x))) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + Float64(0.91893853320467 + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x))) tmp = 0.0 if (z <= -7.6e+84) tmp = Float64(y * Float64((z ^ 2.0) / x)); elseif (z <= -8.8e-18) tmp = t_0; elseif (z <= -2.15e-24) tmp = Float64(Float64(y * (z ^ 2.0)) / x); elseif (z <= 1.15e+114) tmp = t_0; else tmp = Float64(Float64(y / Float64(Float64(1.0 / z) * Float64(x / z))) + Float64(0.91893853320467 + Float64(-0.5 * log(x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + (z * -0.0027777777777778)) / x)); tmp = 0.0; if (z <= -7.6e+84) tmp = y * ((z ^ 2.0) / x); elseif (z <= -8.8e-18) tmp = t_0; elseif (z <= -2.15e-24) tmp = (y * (z ^ 2.0)) / x; elseif (z <= 1.15e+114) tmp = t_0; else tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * log(x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.6e+84], N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.8e-18], t$95$0, If[LessEqual[z, -2.15e-24], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 1.15e+114], t$95$0, N[(N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + \left(0.91893853320467 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\right)\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+84}:\\
\;\;\;\;y \cdot \frac{{z}^{2}}{x}\\
\mathbf{elif}\;z \leq -8.8 \cdot 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+114}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{1}{z} \cdot \frac{x}{z}} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
\end{array}
\end{array}
if z < -7.6000000000000002e84Initial program 92.8%
Taylor expanded in y around inf 68.4%
associate-/l*70.2%
Simplified70.2%
Taylor expanded in x around 0 64.9%
Taylor expanded in x around 0 64.4%
associate-*r/65.0%
Simplified65.0%
if -7.6000000000000002e84 < z < -8.7999999999999994e-18 or -2.1500000000000002e-24 < z < 1.15e114Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
sub-neg97.9%
metadata-eval97.9%
fma-def97.9%
fma-neg97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in z around 0 82.1%
*-commutative82.1%
Simplified82.1%
if -8.7999999999999994e-18 < z < -2.1500000000000002e-24Initial program 98.9%
Taylor expanded in y around inf 99.4%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.4%
if 1.15e114 < z Initial program 85.2%
Taylor expanded in y around inf 59.3%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in x around 0 51.4%
*-un-lft-identity51.4%
unpow251.4%
times-frac51.4%
Applied egg-rr51.4%
Final simplification74.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
(if (<= x 6800000.0)
(+
t_0
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x))
(+ t_0 (* (+ y 0.0007936500793651) (* z (/ z x)))))))
double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 6800000.0) {
tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z * (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 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
if (x <= 6800000.0d0) then
tmp = t_0 + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
else
tmp = t_0 + ((y + 0.0007936500793651d0) * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
double tmp;
if (x <= 6800000.0) {
tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
} else {
tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x) tmp = 0 if x <= 6800000.0: tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) else: tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x))) return tmp
function code(x, y, z) t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) tmp = 0.0 if (x <= 6800000.0) tmp = Float64(t_0 + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)); else tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x); tmp = 0.0; if (x <= 6800000.0) tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x); else tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 6800000.0], N[(t$95$0 + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;x \leq 6800000:\\
\;\;\;\;t_0 + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 6.8e6Initial program 99.7%
if 6.8e6 < x Initial program 89.4%
Taylor expanded in z around inf 89.4%
associate-/l*92.6%
+-commutative92.6%
associate-/r/92.6%
+-commutative92.6%
Simplified92.6%
unpow292.6%
*-un-lft-identity92.6%
times-frac98.9%
Applied egg-rr98.9%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ (pow z 2.0) x))))
(if (<= z -4.5e+83)
t_0
(if (<= z -6.6e-18)
(+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))
(if (<= z -2.15e-24)
(/ (* y (pow z 2.0)) x)
(if (<= z 2.2e+121)
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ 0.083333333333333 x))
t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (pow(z, 2.0) / x);
double tmp;
if (z <= -4.5e+83) {
tmp = t_0;
} else if (z <= -6.6e-18) {
tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
} else if (z <= -2.15e-24) {
tmp = (y * pow(z, 2.0)) / x;
} else if (z <= 2.2e+121) {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * ((z ** 2.0d0) / x)
if (z <= (-4.5d+83)) then
tmp = t_0
else if (z <= (-6.6d-18)) then
tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
else if (z <= (-2.15d-24)) then
tmp = (y * (z ** 2.0d0)) / x
else if (z <= 2.2d+121) then
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (Math.pow(z, 2.0) / x);
double tmp;
if (z <= -4.5e+83) {
tmp = t_0;
} else if (z <= -6.6e-18) {
tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
} else if (z <= -2.15e-24) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else if (z <= 2.2e+121) {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (math.pow(z, 2.0) / x) tmp = 0 if z <= -4.5e+83: tmp = t_0 elif z <= -6.6e-18: tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) elif z <= -2.15e-24: tmp = (y * math.pow(z, 2.0)) / x elif z <= 2.2e+121: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64((z ^ 2.0) / x)) tmp = 0.0 if (z <= -4.5e+83) tmp = t_0; elseif (z <= -6.6e-18) tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)); elseif (z <= -2.15e-24) tmp = Float64(Float64(y * (z ^ 2.0)) / x); elseif (z <= 2.2e+121) tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * ((z ^ 2.0) / x); tmp = 0.0; if (z <= -4.5e+83) tmp = t_0; elseif (z <= -6.6e-18) tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x); elseif (z <= -2.15e-24) tmp = (y * (z ^ 2.0)) / x; elseif (z <= 2.2e+121) tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+83], t$95$0, If[LessEqual[z, -6.6e-18], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.15e-24], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 2.2e+121], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{{z}^{2}}{x}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+83}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+121}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -4.4999999999999999e83 or 2.20000000000000001e121 < z Initial program 89.5%
Taylor expanded in y around inf 65.3%
associate-/l*66.3%
Simplified66.3%
Taylor expanded in x around 0 59.9%
Taylor expanded in x around 0 59.7%
associate-*r/60.0%
Simplified60.0%
if -4.4999999999999999e83 < z < -6.6000000000000003e-18Initial program 91.3%
Taylor expanded in z around 0 60.7%
Taylor expanded in x around inf 60.9%
sub-neg60.9%
mul-1-neg60.9%
log-rec60.9%
remove-double-neg60.9%
metadata-eval60.9%
Simplified60.9%
if -6.6000000000000003e-18 < z < -2.1500000000000002e-24Initial program 98.9%
Taylor expanded in y around inf 99.4%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.4%
if -2.1500000000000002e-24 < z < 2.20000000000000001e121Initial program 98.9%
Taylor expanded in z around 0 83.8%
Final simplification73.9%
(FPCore (x y z)
:precision binary64
(if (<= x 5.8e+185)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(* x (+ (log x) -1.0)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/ y (* (/ 1.0 z) (/ x z))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+185) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y / ((1.0 / z) * (x / z)));
}
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+185) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (y / ((1.0d0 / z) * (x / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5.8e+185) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (y / ((1.0 / z) * (x / z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5.8e+185: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (math.log(x) + -1.0)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (y / ((1.0 / z) * (x / z))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5.8e+185) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(y / Float64(Float64(1.0 / z) * Float64(x / z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5.8e+185) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (y / ((1.0 / z) * (x / z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5.8e+185], 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], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.8 \cdot 10^{+185}:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\
\end{array}
\end{array}
if x < 5.79999999999999976e185Initial program 97.1%
Taylor expanded in x around inf 95.5%
sub-neg48.5%
mul-1-neg48.5%
log-rec48.9%
remove-double-neg48.9%
metadata-eval48.9%
Simplified96.0%
if 5.79999999999999976e185 < x Initial program 84.1%
Taylor expanded in y around inf 83.6%
associate-/l*90.2%
Simplified90.2%
*-un-lft-identity11.7%
unpow211.7%
times-frac11.6%
Applied egg-rr97.5%
Final simplification96.2%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00031)
(+
(/
(+
(* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
0.083333333333333)
x)
(* x (+ (log x) -1.0)))
(+
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(* (+ y 0.0007936500793651) (* z (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00031) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (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 <= 0.00031d0) then
tmp = (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x) + (x * (log(x) + (-1.0d0)))
else
tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((y + 0.0007936500793651d0) * (z * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 0.00031) {
tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (Math.log(x) + -1.0));
} else {
tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 0.00031: tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (math.log(x) + -1.0)) else: tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 0.00031) tmp = Float64(Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + Float64(x * Float64(log(x) + -1.0))); else tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 0.00031) tmp = (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x) + (x * (log(x) + -1.0)); else tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 0.00031], 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], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00031:\\
\;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + x \cdot \left(\log x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 3.1e-4Initial program 99.7%
Taylor expanded in x around inf 98.2%
sub-neg46.5%
mul-1-neg46.5%
log-rec47.2%
remove-double-neg47.2%
metadata-eval47.2%
Simplified98.9%
if 3.1e-4 < x Initial program 89.8%
Taylor expanded in z around inf 88.9%
associate-/l*92.0%
+-commutative92.0%
associate-/r/91.9%
+-commutative91.9%
Simplified91.9%
unpow291.9%
*-un-lft-identity91.9%
times-frac98.0%
Applied egg-rr98.0%
Final simplification98.5%
(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 95.0%
Taylor expanded in x around inf 93.7%
sub-neg54.5%
mul-1-neg54.5%
log-rec54.9%
remove-double-neg54.9%
metadata-eval54.9%
Simplified94.1%
Final simplification94.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
(t_1 (* y (/ (pow z 2.0) x))))
(if (<= z -7.2e+84)
t_1
(if (<= z -6.6e-18)
t_0
(if (<= z -2.15e-24)
(/ (* y (pow z 2.0)) x)
(if (<= z 8.5e+120) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
double t_1 = y * (pow(z, 2.0) / x);
double tmp;
if (z <= -7.2e+84) {
tmp = t_1;
} else if (z <= -6.6e-18) {
tmp = t_0;
} else if (z <= -2.15e-24) {
tmp = (y * pow(z, 2.0)) / x;
} else if (z <= 8.5e+120) {
tmp = t_0;
} else {
tmp = t_1;
}
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 = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
t_1 = y * ((z ** 2.0d0) / x)
if (z <= (-7.2d+84)) then
tmp = t_1
else if (z <= (-6.6d-18)) then
tmp = t_0
else if (z <= (-2.15d-24)) then
tmp = (y * (z ** 2.0d0)) / x
else if (z <= 8.5d+120) then
tmp = t_0
else
tmp = t_1
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)) + (0.083333333333333 / x);
double t_1 = y * (Math.pow(z, 2.0) / x);
double tmp;
if (z <= -7.2e+84) {
tmp = t_1;
} else if (z <= -6.6e-18) {
tmp = t_0;
} else if (z <= -2.15e-24) {
tmp = (y * Math.pow(z, 2.0)) / x;
} else if (z <= 8.5e+120) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x) t_1 = y * (math.pow(z, 2.0) / x) tmp = 0 if z <= -7.2e+84: tmp = t_1 elif z <= -6.6e-18: tmp = t_0 elif z <= -2.15e-24: tmp = (y * math.pow(z, 2.0)) / x elif z <= 8.5e+120: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x)) t_1 = Float64(y * Float64((z ^ 2.0) / x)) tmp = 0.0 if (z <= -7.2e+84) tmp = t_1; elseif (z <= -6.6e-18) tmp = t_0; elseif (z <= -2.15e-24) tmp = Float64(Float64(y * (z ^ 2.0)) / x); elseif (z <= 8.5e+120) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x * (log(x) + -1.0)) + (0.083333333333333 / x); t_1 = y * ((z ^ 2.0) / x); tmp = 0.0; if (z <= -7.2e+84) tmp = t_1; elseif (z <= -6.6e-18) tmp = t_0; elseif (z <= -2.15e-24) tmp = (y * (z ^ 2.0)) / x; elseif (z <= 8.5e+120) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+84], t$95$1, If[LessEqual[z, -6.6e-18], t$95$0, If[LessEqual[z, -2.15e-24], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 8.5e+120], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
t_1 := y \cdot \frac{{z}^{2}}{x}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+120}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.1999999999999999e84 or 8.50000000000000026e120 < z Initial program 89.5%
Taylor expanded in y around inf 65.3%
associate-/l*66.3%
Simplified66.3%
Taylor expanded in x around 0 59.9%
Taylor expanded in x around 0 59.7%
associate-*r/60.0%
Simplified60.0%
if -7.1999999999999999e84 < z < -6.6000000000000003e-18 or -2.1500000000000002e-24 < z < 8.50000000000000026e120Initial program 97.9%
Taylor expanded in z around 0 80.7%
Taylor expanded in x around inf 78.6%
sub-neg78.6%
mul-1-neg78.6%
log-rec79.2%
remove-double-neg79.2%
metadata-eval79.2%
Simplified79.2%
if -6.6000000000000003e-18 < z < -2.1500000000000002e-24Initial program 98.9%
Taylor expanded in y around inf 99.4%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in x around 0 99.4%
Taylor expanded in x around 0 99.4%
Final simplification73.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.05e-86) (not (<= z 2.25e-12))) (* y (/ (pow z 2.0) x)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.05e-86) || !(z <= 2.25e-12)) {
tmp = y * (pow(z, 2.0) / x);
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2.05d-86)) .or. (.not. (z <= 2.25d-12))) then
tmp = y * ((z ** 2.0d0) / x)
else
tmp = 0.083333333333333d0 / x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.05e-86) || !(z <= 2.25e-12)) {
tmp = y * (Math.pow(z, 2.0) / x);
} else {
tmp = 0.083333333333333 / x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.05e-86) or not (z <= 2.25e-12): tmp = y * (math.pow(z, 2.0) / x) else: tmp = 0.083333333333333 / x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.05e-86) || !(z <= 2.25e-12)) tmp = Float64(y * Float64((z ^ 2.0) / x)); else tmp = Float64(0.083333333333333 / x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.05e-86) || ~((z <= 2.25e-12))) tmp = y * ((z ^ 2.0) / x); else tmp = 0.083333333333333 / x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.05e-86], N[Not[LessEqual[z, 2.25e-12]], $MachinePrecision]], N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-86} \lor \neg \left(z \leq 2.25 \cdot 10^{-12}\right):\\
\;\;\;\;y \cdot \frac{{z}^{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x}\\
\end{array}
\end{array}
if z < -2.0499999999999999e-86 or 2.2499999999999999e-12 < z Initial program 92.3%
Taylor expanded in y around inf 68.7%
associate-/l*71.0%
Simplified71.0%
Taylor expanded in x around 0 47.9%
Taylor expanded in x around 0 46.7%
associate-*r/48.0%
Simplified48.0%
if -2.0499999999999999e-86 < z < 2.2499999999999999e-12Initial program 99.6%
Taylor expanded in z around 0 98.2%
Taylor expanded in x around inf 95.3%
sub-neg95.3%
mul-1-neg95.3%
log-rec96.3%
remove-double-neg96.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in x around 0 61.4%
Final simplification53.1%
(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 95.0%
Taylor expanded in z around 0 55.8%
Taylor expanded in x around inf 54.5%
sub-neg54.5%
mul-1-neg54.5%
log-rec54.9%
remove-double-neg54.9%
metadata-eval54.9%
Simplified54.9%
Taylor expanded in x around 0 26.4%
Final simplification26.4%
(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 2023320
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))