
(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 18 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+25)
(fma
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
(pow x -1.0)
(fma (log x) (- x 0.5) (fma -1.0 x 0.91893853320467)))
(+
(/
1.0
(/
(/
(fma
(/ x (* (pow (+ y 0.0007936500793651) 2.0) z))
0.0027777777777778
(/ x (+ y 0.0007936500793651)))
z)
z))
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+25) {
tmp = fma(fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), pow(x, -1.0), fma(log(x), (x - 0.5), fma(-1.0, x, 0.91893853320467)));
} else {
tmp = (1.0 / ((fma((x / (pow((y + 0.0007936500793651), 2.0) * z)), 0.0027777777777778, (x / (y + 0.0007936500793651))) / z) / z)) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5e+25) tmp = fma(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), (x ^ -1.0), fma(log(x), Float64(x - 0.5), fma(-1.0, x, 0.91893853320467))); else tmp = Float64(Float64(1.0 / Float64(Float64(fma(Float64(x / Float64((Float64(y + 0.0007936500793651) ^ 2.0) * z)), 0.0027777777777778, Float64(x / Float64(y + 0.0007936500793651))) / z) / z)) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5e+25], N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[Power[x, -1.0], $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(-1.0 * x + 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(N[(N[(x / N[(N[Power[N[(y + 0.0007936500793651), $MachinePrecision], 2.0], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * 0.0027777777777778 + N[(x / N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right), {x}^{-1}, \mathsf{fma}\left(\log x, x - 0.5, \mathsf{fma}\left(-1, x, 0.91893853320467\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(\frac{x}{{\left(y + 0.0007936500793651\right)}^{2} \cdot z}, 0.0027777777777778, \frac{x}{y + 0.0007936500793651}\right)}{z}}{z}} + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 5.00000000000000024e25Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.8
Applied rewrites99.8%
if 5.00000000000000024e25 < x Initial program 91.2%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6472.3
Applied rewrites72.3%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6472.3
Applied rewrites72.3%
Taylor expanded in z around inf
+-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
(if (<= t_0 -2e+149)
(* (* (/ (* z z) x) (+ (/ 0.0007936500793651 y) 1.0)) y)
(if (<= t_0 5e+306)
(+
(/
(fma
(fma 0.0007936500793651 z -0.0027777777777778)
z
0.083333333333333)
x)
(fma (- x 0.5) (log x) (- 0.91893853320467 x)))
(* (* (+ (/ 1.0 (* 1260.0011340009878 x)) (/ y x)) z) z)))))
double code(double x, double y, double z) {
double t_0 = ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
double tmp;
if (t_0 <= -2e+149) {
tmp = (((z * z) / x) * ((0.0007936500793651 / y) + 1.0)) * y;
} else if (t_0 <= 5e+306) {
tmp = (fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) + fma((x - 0.5), log(x), (0.91893853320467 - x));
} else {
tmp = (((1.0 / (1260.0011340009878 * x)) + (y / x)) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)) tmp = 0.0 if (t_0 <= -2e+149) tmp = Float64(Float64(Float64(Float64(z * z) / x) * Float64(Float64(0.0007936500793651 / y) + 1.0)) * y); elseif (t_0 <= 5e+306) tmp = Float64(Float64(fma(fma(0.0007936500793651, z, -0.0027777777777778), z, 0.083333333333333) / x) + fma(Float64(x - 0.5), log(x), Float64(0.91893853320467 - x))); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(1260.0011340009878 * x)) + Float64(y / x)) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+149], N[(N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * N[(N[(0.0007936500793651 / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(N[(N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(1260.0011340009878 * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+149}:\\
\;\;\;\;\left(\frac{z \cdot z}{x} \cdot \left(\frac{0.0007936500793651}{y} + 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} + \mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{1260.0011340009878 \cdot x} + \frac{y}{x}\right) \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -2.0000000000000001e149Initial program 94.4%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6494.2
Applied rewrites94.2%
Taylor expanded in y around inf
Applied rewrites99.9%
if -2.0000000000000001e149 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.99999999999999993e306Initial program 99.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f6496.5
Applied rewrites96.5%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower--.f6496.6
Applied rewrites96.6%
if 4.99999999999999993e306 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) Initial program 88.0%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6497.5
Applied rewrites97.5%
Applied rewrites97.5%
Final simplification97.3%
(FPCore (x y z)
:precision binary64
(if (<= x 5e+25)
(fma
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
(pow x -1.0)
(fma (log x) (- x 0.5) (fma -1.0 x 0.91893853320467)))
(-
(+
(fma (- x 0.5) (log x) 0.91893853320467)
(* (* (/ (+ y 0.0007936500793651) x) z) z))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+25) {
tmp = fma(fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), pow(x, -1.0), fma(log(x), (x - 0.5), fma(-1.0, x, 0.91893853320467)));
} else {
tmp = (fma((x - 0.5), log(x), 0.91893853320467) + ((((y + 0.0007936500793651) / x) * z) * z)) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5e+25) tmp = fma(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), (x ^ -1.0), fma(log(x), Float64(x - 0.5), fma(-1.0, x, 0.91893853320467))); else tmp = Float64(Float64(fma(Float64(x - 0.5), log(x), 0.91893853320467) + Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z)) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5e+25], N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[Power[x, -1.0], $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(-1.0 * x + 0.91893853320467), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right), {x}^{-1}, \mathsf{fma}\left(\log x, x - 0.5, \mathsf{fma}\left(-1, x, 0.91893853320467\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467\right) + \left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z\right) - x\\
\end{array}
\end{array}
if x < 5.00000000000000024e25Initial program 99.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6499.8
Applied rewrites99.8%
if 5.00000000000000024e25 < x Initial program 91.2%
Taylor expanded in y around 0
Applied rewrites99.5%
Taylor expanded in z around -inf
Applied rewrites99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)))
(if (<= t_0 -1e+38)
(* (* (/ (* z z) x) (+ (/ 0.0007936500793651 y) 1.0)) y)
(if (<= t_0 2e+109)
(+
(/ (fma -0.0027777777777778 z 0.083333333333333) x)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))
(* (* (+ (/ 1.0 (* 1260.0011340009878 x)) (/ y x)) z) z)))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double tmp;
if (t_0 <= -1e+38) {
tmp = (((z * z) / x) * ((0.0007936500793651 / y) + 1.0)) * y;
} else if (t_0 <= 2e+109) {
tmp = (fma(-0.0027777777777778, z, 0.083333333333333) / x) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
} else {
tmp = (((1.0 / (1260.0011340009878 * x)) + (y / x)) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) tmp = 0.0 if (t_0 <= -1e+38) tmp = Float64(Float64(Float64(Float64(z * z) / x) * Float64(Float64(0.0007936500793651 / y) + 1.0)) * y); elseif (t_0 <= 2e+109) tmp = Float64(Float64(fma(-0.0027777777777778, z, 0.083333333333333) / x) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(1260.0011340009878 * x)) + Float64(y / x)) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+38], N[(N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * N[(N[(0.0007936500793651 / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e+109], N[(N[(N[(-0.0027777777777778 * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(1260.0011340009878 * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+38}:\\
\;\;\;\;\left(\frac{z \cdot z}{x} \cdot \left(\frac{0.0007936500793651}{y} + 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+109}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.0027777777777778, z, 0.083333333333333\right)}{x} + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{1260.0011340009878 \cdot x} + \frac{y}{x}\right) \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -9.99999999999999977e37Initial program 94.7%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6488.8
Applied rewrites88.8%
Taylor expanded in y around inf
Applied rewrites94.2%
if -9.99999999999999977e37 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1.99999999999999996e109Initial program 99.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6495.4
Applied rewrites95.4%
if 1.99999999999999996e109 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 90.0%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6491.2
Applied rewrites91.2%
Applied rewrites91.2%
Final simplification93.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)))
(if (<= t_0 -1e+38)
(* (* (/ (* z z) x) (+ (/ 0.0007936500793651 y) 1.0)) y)
(if (<= t_0 2e+109)
(fma
(- x 0.5)
(log x)
(- (+ (/ 0.083333333333333 x) 0.91893853320467) x))
(* (* (+ (/ 1.0 (* 1260.0011340009878 x)) (/ y x)) z) z)))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double tmp;
if (t_0 <= -1e+38) {
tmp = (((z * z) / x) * ((0.0007936500793651 / y) + 1.0)) * y;
} else if (t_0 <= 2e+109) {
tmp = fma((x - 0.5), log(x), (((0.083333333333333 / x) + 0.91893853320467) - x));
} else {
tmp = (((1.0 / (1260.0011340009878 * x)) + (y / x)) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) tmp = 0.0 if (t_0 <= -1e+38) tmp = Float64(Float64(Float64(Float64(z * z) / x) * Float64(Float64(0.0007936500793651 / y) + 1.0)) * y); elseif (t_0 <= 2e+109) tmp = fma(Float64(x - 0.5), log(x), Float64(Float64(Float64(0.083333333333333 / x) + 0.91893853320467) - x)); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(1260.0011340009878 * x)) + Float64(y / x)) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+38], N[(N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * N[(N[(0.0007936500793651 / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e+109], N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(N[(0.083333333333333 / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(1260.0011340009878 * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+38}:\\
\;\;\;\;\left(\frac{z \cdot z}{x} \cdot \left(\frac{0.0007936500793651}{y} + 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(x - 0.5, \log x, \left(\frac{0.083333333333333}{x} + 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{1260.0011340009878 \cdot x} + \frac{y}{x}\right) \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -9.99999999999999977e37Initial program 94.7%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6488.8
Applied rewrites88.8%
Taylor expanded in y around inf
Applied rewrites94.2%
if -9.99999999999999977e37 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1.99999999999999996e109Initial program 99.5%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6495.4
Applied rewrites95.4%
if 1.99999999999999996e109 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 90.0%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6491.2
Applied rewrites91.2%
Applied rewrites91.2%
Final simplification93.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)))
(if (<= t_0 -1e+38)
(* (* (/ (* z z) x) (+ (/ 0.0007936500793651 y) 1.0)) y)
(if (<= t_0 2e+109)
(+
(fma (log x) (+ -0.5 x) (/ 0.083333333333333 x))
(- 0.91893853320467 x))
(* (* (+ (/ 1.0 (* 1260.0011340009878 x)) (/ y x)) z) z)))))
double code(double x, double y, double z) {
double t_0 = (((y + 0.0007936500793651) * z) - 0.0027777777777778) * z;
double tmp;
if (t_0 <= -1e+38) {
tmp = (((z * z) / x) * ((0.0007936500793651 / y) + 1.0)) * y;
} else if (t_0 <= 2e+109) {
tmp = fma(log(x), (-0.5 + x), (0.083333333333333 / x)) + (0.91893853320467 - x);
} else {
tmp = (((1.0 / (1260.0011340009878 * x)) + (y / x)) * z) * z;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) tmp = 0.0 if (t_0 <= -1e+38) tmp = Float64(Float64(Float64(Float64(z * z) / x) * Float64(Float64(0.0007936500793651 / y) + 1.0)) * y); elseif (t_0 <= 2e+109) tmp = Float64(fma(log(x), Float64(-0.5 + x), Float64(0.083333333333333 / x)) + Float64(0.91893853320467 - x)); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(1260.0011340009878 * x)) + Float64(y / x)) * z) * z); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+38], N[(N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * N[(N[(0.0007936500793651 / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, 2e+109], N[(N[(N[Log[x], $MachinePrecision] * N[(-0.5 + x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(1260.0011340009878 * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+38}:\\
\;\;\;\;\left(\frac{z \cdot z}{x} \cdot \left(\frac{0.0007936500793651}{y} + 1\right)\right) \cdot y\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+109}:\\
\;\;\;\;\mathsf{fma}\left(\log x, -0.5 + x, \frac{0.083333333333333}{x}\right) + \left(0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{1260.0011340009878 \cdot x} + \frac{y}{x}\right) \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -9.99999999999999977e37Initial program 94.7%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6488.8
Applied rewrites88.8%
Taylor expanded in y around inf
Applied rewrites94.2%
if -9.99999999999999977e37 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 1.99999999999999996e109Initial program 99.5%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f643.8
Applied rewrites3.8%
Taylor expanded in z around 0
sub-negN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
unsub-negN/A
lower--.f64N/A
+-commutativeN/A
Applied rewrites95.3%
if 1.99999999999999996e109 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 90.0%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6491.2
Applied rewrites91.2%
Applied rewrites91.2%
Final simplification93.8%
(FPCore (x y z)
:precision binary64
(if (<= x 4.4e+25)
(/
(fma
(+ (fma (- x 0.5) (log x) (- x)) 0.91893853320467)
x
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333))
x)
(-
(+
(fma (- x 0.5) (log x) 0.91893853320467)
(* (* (/ (+ y 0.0007936500793651) x) z) z))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 4.4e+25) {
tmp = fma((fma((x - 0.5), log(x), -x) + 0.91893853320467), x, fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else {
tmp = (fma((x - 0.5), log(x), 0.91893853320467) + ((((y + 0.0007936500793651) / x) * z) * z)) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 4.4e+25) tmp = Float64(fma(Float64(fma(Float64(x - 0.5), log(x), Float64(-x)) + 0.91893853320467), x, fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x); else tmp = Float64(Float64(fma(Float64(x - 0.5), log(x), 0.91893853320467) + Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z)) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 4.4e+25], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.4 \cdot 10^{+25}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x - 0.5, \log x, -x\right) + 0.91893853320467, x, \mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467\right) + \left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z\right) - x\\
\end{array}
\end{array}
if x < 4.4000000000000001e25Initial program 99.7%
Taylor expanded in x around 0
Applied rewrites99.8%
if 4.4000000000000001e25 < x Initial program 91.2%
Taylor expanded in y around 0
Applied rewrites99.5%
Taylor expanded in z around -inf
Applied rewrites99.5%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 5000000000000.0)
(-
(/
(fma
(fma (log x) (- x 0.5) 0.91893853320467)
x
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333))
x)
x)
(-
(+
(fma (- x 0.5) (log x) 0.91893853320467)
(* (* (/ (+ y 0.0007936500793651) x) z) z))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 5000000000000.0) {
tmp = (fma(fma(log(x), (x - 0.5), 0.91893853320467), x, fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x) - x;
} else {
tmp = (fma((x - 0.5), log(x), 0.91893853320467) + ((((y + 0.0007936500793651) / x) * z) * z)) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5000000000000.0) tmp = Float64(Float64(fma(fma(log(x), Float64(x - 0.5), 0.91893853320467), x, fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x) - x); else tmp = Float64(Float64(fma(Float64(x - 0.5), log(x), 0.91893853320467) + Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z)) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5000000000000.0], N[(N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - x), $MachinePrecision], N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5000000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467\right), x, \mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x} - x\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467\right) + \left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z\right) - x\\
\end{array}
\end{array}
if x < 5e12Initial program 99.7%
Taylor expanded in y around 0
Applied rewrites86.0%
Taylor expanded in x around 0
Applied rewrites99.8%
if 5e12 < x Initial program 91.6%
Taylor expanded in y around 0
Applied rewrites99.6%
Taylor expanded in z around -inf
Applied rewrites99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 36.0)
(/
(fma
(fma (log x) -0.5 0.91893853320467)
x
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333))
x)
(-
(+
(fma (- x 0.5) (log x) 0.91893853320467)
(* (* (/ (+ y 0.0007936500793651) x) z) z))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 36.0) {
tmp = fma(fma(log(x), -0.5, 0.91893853320467), x, fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else {
tmp = (fma((x - 0.5), log(x), 0.91893853320467) + ((((y + 0.0007936500793651) / x) * z) * z)) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 36.0) tmp = Float64(fma(fma(log(x), -0.5, 0.91893853320467), x, fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333)) / x); else tmp = Float64(Float64(fma(Float64(x - 0.5), log(x), 0.91893853320467) + Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z)) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 36.0], N[(N[(N[(N[Log[x], $MachinePrecision] * -0.5 + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 36:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\log x, -0.5, 0.91893853320467\right), x, \mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467\right) + \left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z\right) - x\\
\end{array}
\end{array}
if x < 36Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites97.4%
if 36 < x Initial program 92.2%
Taylor expanded in y around 0
Applied rewrites99.6%
Taylor expanded in z around -inf
Applied rewrites99.2%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(if (<= x 2.1e+39)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (- (log x) 1.0) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.1e+39) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (log(x) - 1.0) * x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2.1e+39) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(log(x) - 1.0) * x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2.1e+39], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.1 \cdot 10^{+39}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 2.0999999999999999e39Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6492.5
Applied rewrites92.5%
if 2.0999999999999999e39 < x Initial program 90.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
div-invN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
metadata-evalN/A
inv-powN/A
lower-pow.f6490.8
Applied rewrites90.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6474.4
Applied rewrites74.4%
Final simplification84.4%
(FPCore (x y z)
:precision binary64
(if (<= x 1.95e+60)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (* (+ (/ 1.0 (* 1260.0011340009878 x)) (/ y x)) z) z)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.95e+60) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (((1.0 / (1260.0011340009878 * x)) + (y / x)) * z) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.95e+60) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(1260.0011340009878 * x)) + Float64(y / x)) * z) * z); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.95e+60], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(1260.0011340009878 * x), $MachinePrecision]), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.95 \cdot 10^{+60}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{1260.0011340009878 \cdot x} + \frac{y}{x}\right) \cdot z\right) \cdot z\\
\end{array}
\end{array}
if x < 1.95000000000000015e60Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6488.1
Applied rewrites88.1%
if 1.95000000000000015e60 < x Initial program 89.8%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6426.6
Applied rewrites26.6%
Applied rewrites26.6%
Final simplification63.4%
(FPCore (x y z)
:precision binary64
(if (<= (+ y 0.0007936500793651) -10000.0)
(* (/ (* z z) x) y)
(if (<= (+ y 0.0007936500793651) 0.0008)
(* (* (/ z x) 0.0007936500793651) z)
(* (* (/ z x) y) z))))
double code(double x, double y, double z) {
double tmp;
if ((y + 0.0007936500793651) <= -10000.0) {
tmp = ((z * z) / x) * y;
} else if ((y + 0.0007936500793651) <= 0.0008) {
tmp = ((z / x) * 0.0007936500793651) * z;
} else {
tmp = ((z / x) * y) * 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 ((y + 0.0007936500793651d0) <= (-10000.0d0)) then
tmp = ((z * z) / x) * y
else if ((y + 0.0007936500793651d0) <= 0.0008d0) then
tmp = ((z / x) * 0.0007936500793651d0) * z
else
tmp = ((z / x) * y) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y + 0.0007936500793651) <= -10000.0) {
tmp = ((z * z) / x) * y;
} else if ((y + 0.0007936500793651) <= 0.0008) {
tmp = ((z / x) * 0.0007936500793651) * z;
} else {
tmp = ((z / x) * y) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y + 0.0007936500793651) <= -10000.0: tmp = ((z * z) / x) * y elif (y + 0.0007936500793651) <= 0.0008: tmp = ((z / x) * 0.0007936500793651) * z else: tmp = ((z / x) * y) * z return tmp
function code(x, y, z) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -10000.0) tmp = Float64(Float64(Float64(z * z) / x) * y); elseif (Float64(y + 0.0007936500793651) <= 0.0008) tmp = Float64(Float64(Float64(z / x) * 0.0007936500793651) * z); else tmp = Float64(Float64(Float64(z / x) * y) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y + 0.0007936500793651) <= -10000.0) tmp = ((z * z) / x) * y; elseif ((y + 0.0007936500793651) <= 0.0008) tmp = ((z / x) * 0.0007936500793651) * z; else tmp = ((z / x) * y) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -10000.0], N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.0008], N[(N[(N[(z / x), $MachinePrecision] * 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + 0.0007936500793651 \leq -10000:\\
\;\;\;\;\frac{z \cdot z}{x} \cdot y\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 0.0008:\\
\;\;\;\;\left(\frac{z}{x} \cdot 0.0007936500793651\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot y\right) \cdot z\\
\end{array}
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -1e4Initial program 97.0%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.1
Applied rewrites46.1%
Applied rewrites48.8%
if -1e4 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 8.00000000000000038e-4Initial program 93.9%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6441.6
Applied rewrites41.6%
Taylor expanded in y around 0
Applied rewrites41.6%
if 8.00000000000000038e-4 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 98.3%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6450.9
Applied rewrites50.9%
Taylor expanded in y around inf
Applied rewrites50.2%
Final simplification45.5%
(FPCore (x y z)
:precision binary64
(if (<= (+ y 0.0007936500793651) -10000.0)
(* (/ (* z z) x) y)
(if (<= (+ y 0.0007936500793651) 0.0008)
(* (* (/ z x) 0.0007936500793651) z)
(* (* (/ y x) z) z))))
double code(double x, double y, double z) {
double tmp;
if ((y + 0.0007936500793651) <= -10000.0) {
tmp = ((z * z) / x) * y;
} else if ((y + 0.0007936500793651) <= 0.0008) {
tmp = ((z / x) * 0.0007936500793651) * z;
} else {
tmp = ((y / x) * z) * 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 ((y + 0.0007936500793651d0) <= (-10000.0d0)) then
tmp = ((z * z) / x) * y
else if ((y + 0.0007936500793651d0) <= 0.0008d0) then
tmp = ((z / x) * 0.0007936500793651d0) * z
else
tmp = ((y / x) * z) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y + 0.0007936500793651) <= -10000.0) {
tmp = ((z * z) / x) * y;
} else if ((y + 0.0007936500793651) <= 0.0008) {
tmp = ((z / x) * 0.0007936500793651) * z;
} else {
tmp = ((y / x) * z) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y + 0.0007936500793651) <= -10000.0: tmp = ((z * z) / x) * y elif (y + 0.0007936500793651) <= 0.0008: tmp = ((z / x) * 0.0007936500793651) * z else: tmp = ((y / x) * z) * z return tmp
function code(x, y, z) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -10000.0) tmp = Float64(Float64(Float64(z * z) / x) * y); elseif (Float64(y + 0.0007936500793651) <= 0.0008) tmp = Float64(Float64(Float64(z / x) * 0.0007936500793651) * z); else tmp = Float64(Float64(Float64(y / x) * z) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y + 0.0007936500793651) <= -10000.0) tmp = ((z * z) / x) * y; elseif ((y + 0.0007936500793651) <= 0.0008) tmp = ((z / x) * 0.0007936500793651) * z; else tmp = ((y / x) * z) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -10000.0], N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.0008], N[(N[(N[(z / x), $MachinePrecision] * 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y + 0.0007936500793651 \leq -10000:\\
\;\;\;\;\frac{z \cdot z}{x} \cdot y\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 0.0008:\\
\;\;\;\;\left(\frac{z}{x} \cdot 0.0007936500793651\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y}{x} \cdot z\right) \cdot z\\
\end{array}
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -1e4Initial program 97.0%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.1
Applied rewrites46.1%
Applied rewrites48.8%
if -1e4 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 8.00000000000000038e-4Initial program 93.9%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6441.6
Applied rewrites41.6%
Taylor expanded in y around 0
Applied rewrites41.6%
if 8.00000000000000038e-4 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 98.3%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.9
Applied rewrites49.9%
Applied rewrites50.1%
Final simplification45.5%
(FPCore (x y z)
:precision binary64
(if (<= x 1.95e+60)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (* (/ (+ y 0.0007936500793651) x) z) z)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.95e+60) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = (((y + 0.0007936500793651) / x) * z) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.95e+60) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.95e+60], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.95 \cdot 10^{+60}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z\\
\end{array}
\end{array}
if x < 1.95000000000000015e60Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6488.1
Applied rewrites88.1%
if 1.95000000000000015e60 < x Initial program 89.8%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6426.6
Applied rewrites26.6%
Taylor expanded in x around 0
Applied rewrites26.6%
Final simplification63.4%
(FPCore (x y z) :precision binary64 (* (* (/ (+ y 0.0007936500793651) x) z) z))
double code(double x, double y, double z) {
return (((y + 0.0007936500793651) / x) * z) * z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((y + 0.0007936500793651d0) / x) * z) * z
end function
public static double code(double x, double y, double z) {
return (((y + 0.0007936500793651) / x) * z) * z;
}
def code(x, y, z): return (((y + 0.0007936500793651) / x) * z) * z
function code(x, y, z) return Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z) end
function tmp = code(x, y, z) tmp = (((y + 0.0007936500793651) / x) * z) * z; end
code[x_, y_, z_] := N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z
\end{array}
Initial program 95.7%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6445.0
Applied rewrites45.0%
Taylor expanded in x around 0
Applied rewrites45.1%
Final simplification45.1%
(FPCore (x y z) :precision binary64 (/ (* (* (+ y 0.0007936500793651) z) z) x))
double code(double x, double y, double z) {
return (((y + 0.0007936500793651) * z) * z) / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (((y + 0.0007936500793651d0) * z) * z) / x
end function
public static double code(double x, double y, double z) {
return (((y + 0.0007936500793651) * z) * z) / x;
}
def code(x, y, z): return (((y + 0.0007936500793651) * z) * z) / x
function code(x, y, z) return Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) * z) / x) end
function tmp = code(x, y, z) tmp = (((y + 0.0007936500793651) * z) * z) / x; end
code[x_, y_, z_] := N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(y + 0.0007936500793651\right) \cdot z\right) \cdot z}{x}
\end{array}
Initial program 95.7%
Taylor expanded in z around inf
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6445.0
Applied rewrites45.0%
Taylor expanded in y around inf
Applied rewrites41.0%
Taylor expanded in x around 0
Applied rewrites42.6%
Final simplification42.6%
(FPCore (x y z) :precision binary64 (* (/ (* z z) x) y))
double code(double x, double y, double z) {
return ((z * z) / x) * y;
}
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) / x) * y
end function
public static double code(double x, double y, double z) {
return ((z * z) / x) * y;
}
def code(x, y, z): return ((z * z) / x) * y
function code(x, y, z) return Float64(Float64(Float64(z * z) / x) * y) end
function tmp = code(x, y, z) tmp = ((z * z) / x) * y; end
code[x_, y_, z_] := N[(N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot z}{x} \cdot y
\end{array}
Initial program 95.7%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.9
Applied rewrites29.9%
Applied rewrites31.3%
Final simplification31.3%
(FPCore (x y z) :precision binary64 (* (* (/ z x) z) y))
double code(double x, double y, double z) {
return ((z / x) * z) * y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((z / x) * z) * y
end function
public static double code(double x, double y, double z) {
return ((z / x) * z) * y;
}
def code(x, y, z): return ((z / x) * z) * y
function code(x, y, z) return Float64(Float64(Float64(z / x) * z) * y) end
function tmp = code(x, y, z) tmp = ((z / x) * z) * y; end
code[x_, y_, z_] := N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{z}{x} \cdot z\right) \cdot y
\end{array}
Initial program 95.7%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.9
Applied rewrites29.9%
Applied rewrites31.3%
Applied rewrites31.3%
Final simplification31.3%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024296
(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)))