
(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 2e-8)
(fma
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
(/ 1.0 x)
(* (- (log x) 1.0) x))
(-
(fma
(fma (/ y x) z (/ (fma 0.0007936500793651 z -0.0027777777777778) x))
z
(fma (- x 0.5) (log x) (/ 0.083333333333333 x)))
(- x 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2e-8) {
tmp = fma(fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), (1.0 / x), ((log(x) - 1.0) * x));
} else {
tmp = fma(fma((y / x), z, (fma(0.0007936500793651, z, -0.0027777777777778) / x)), z, fma((x - 0.5), log(x), (0.083333333333333 / x))) - (x - 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 2e-8) tmp = fma(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), Float64(1.0 / x), Float64(Float64(log(x) - 1.0) * x)); else tmp = Float64(fma(fma(Float64(y / x), z, Float64(fma(0.0007936500793651, z, -0.0027777777777778) / x)), z, fma(Float64(x - 0.5), log(x), Float64(0.083333333333333 / x))) - Float64(x - 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 2e-8], N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y / x), $MachinePrecision] * z + N[(N[(0.0007936500793651 * z + -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * z + N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right), \frac{1}{x}, \left(\log x - 1\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{y}{x}, z, \frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x}\right), z, \mathsf{fma}\left(x - 0.5, \log x, \frac{0.083333333333333}{x}\right)\right) - \left(x - 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 2e-8Initial program 99.6%
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
lower-/.f6499.7
lift-+.f64N/A
Applied rewrites99.7%
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.f6499.7
Applied rewrites99.7%
if 2e-8 < x Initial program 88.0%
Taylor expanded in z around 0
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)))
(t_1 (* (* (/ z x) z) (+ y 0.0007936500793651))))
(if (<= t_0 -5e+85)
t_1
(if (<= t_0 1e+308)
(fma
0.083333333333333
(/ 1.0 x)
(fma (log x) (- x 0.5) (- 0.91893853320467 x)))
t_1))))
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 t_1 = ((z / x) * z) * (y + 0.0007936500793651);
double tmp;
if (t_0 <= -5e+85) {
tmp = t_1;
} else if (t_0 <= 1e+308) {
tmp = fma(0.083333333333333, (1.0 / x), fma(log(x), (x - 0.5), (0.91893853320467 - x)));
} else {
tmp = t_1;
}
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)) t_1 = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)) tmp = 0.0 if (t_0 <= -5e+85) tmp = t_1; elseif (t_0 <= 1e+308) tmp = fma(0.083333333333333, Float64(1.0 / x), fma(log(x), Float64(x - 0.5), Float64(0.91893853320467 - x))); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+85], t$95$1, If[LessEqual[t$95$0, 1e+308], N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\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)\\
t_1 := \left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+308}:\\
\;\;\;\;\mathsf{fma}\left(0.083333333333333, \frac{1}{x}, \mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)) < -5.0000000000000001e85 or 1e308 < (+.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 83.5%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.0
Applied rewrites63.0%
Applied rewrites66.4%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.4
Applied rewrites86.4%
if -5.0000000000000001e85 < (+.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)) < 1e308Initial program 99.4%
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
lower-/.f6499.4
lift-+.f64N/A
Applied rewrites99.5%
Taylor expanded in z around 0
Applied rewrites88.2%
Final simplification87.5%
(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)))
(t_1 (* (* (/ z x) z) (+ y 0.0007936500793651))))
(if (<= t_0 -5e+85)
t_1
(if (<= t_0 1e+308)
(fma
(- x 0.5)
(log x)
(- (+ (/ 0.083333333333333 x) 0.91893853320467) x))
t_1))))
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 t_1 = ((z / x) * z) * (y + 0.0007936500793651);
double tmp;
if (t_0 <= -5e+85) {
tmp = t_1;
} else if (t_0 <= 1e+308) {
tmp = fma((x - 0.5), log(x), (((0.083333333333333 / x) + 0.91893853320467) - x));
} else {
tmp = t_1;
}
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)) t_1 = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)) tmp = 0.0 if (t_0 <= -5e+85) tmp = t_1; elseif (t_0 <= 1e+308) tmp = fma(Float64(x - 0.5), log(x), Float64(Float64(Float64(0.083333333333333 / x) + 0.91893853320467) - x)); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+85], t$95$1, If[LessEqual[t$95$0, 1e+308], N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(N[(0.083333333333333 / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\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)\\
t_1 := \left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+308}:\\
\;\;\;\;\mathsf{fma}\left(x - 0.5, \log x, \left(\frac{0.083333333333333}{x} + 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)) < -5.0000000000000001e85 or 1e308 < (+.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 83.5%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.0
Applied rewrites63.0%
Applied rewrites66.4%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.4
Applied rewrites86.4%
if -5.0000000000000001e85 < (+.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)) < 1e308Initial program 99.4%
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-/.f6488.2
Applied rewrites88.2%
Final simplification87.5%
(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)))
(t_1 (* (* (/ z x) z) (+ y 0.0007936500793651))))
(if (<= t_0 -5e+85)
t_1
(if (<= t_0 1e+308)
(-
(fma (log x) (+ -0.5 x) (/ 0.083333333333333 x))
(- x 0.91893853320467))
t_1))))
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 t_1 = ((z / x) * z) * (y + 0.0007936500793651);
double tmp;
if (t_0 <= -5e+85) {
tmp = t_1;
} else if (t_0 <= 1e+308) {
tmp = fma(log(x), (-0.5 + x), (0.083333333333333 / x)) - (x - 0.91893853320467);
} else {
tmp = t_1;
}
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)) t_1 = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)) tmp = 0.0 if (t_0 <= -5e+85) tmp = t_1; elseif (t_0 <= 1e+308) tmp = Float64(fma(log(x), Float64(-0.5 + x), Float64(0.083333333333333 / x)) - Float64(x - 0.91893853320467)); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+85], t$95$1, If[LessEqual[t$95$0, 1e+308], N[(N[(N[Log[x], $MachinePrecision] * N[(-0.5 + x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - N[(x - 0.91893853320467), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\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)\\
t_1 := \left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+308}:\\
\;\;\;\;\mathsf{fma}\left(\log x, -0.5 + x, \frac{0.083333333333333}{x}\right) - \left(x - 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)) < -5.0000000000000001e85 or 1e308 < (+.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 83.5%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.0
Applied rewrites63.0%
Applied rewrites66.4%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.4
Applied rewrites86.4%
if -5.0000000000000001e85 < (+.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)) < 1e308Initial program 99.4%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f647.6
Applied rewrites7.6%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
Applied rewrites88.2%
Final simplification87.5%
(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)))
(t_1 (* (* (/ z x) z) (+ y 0.0007936500793651))))
(if (<= t_0 -5e+85)
t_1
(if (<= t_0 1e+308)
(fma 0.083333333333333 (/ 1.0 x) (* (- (log x) 1.0) x))
t_1))))
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 t_1 = ((z / x) * z) * (y + 0.0007936500793651);
double tmp;
if (t_0 <= -5e+85) {
tmp = t_1;
} else if (t_0 <= 1e+308) {
tmp = fma(0.083333333333333, (1.0 / x), ((log(x) - 1.0) * x));
} else {
tmp = t_1;
}
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)) t_1 = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)) tmp = 0.0 if (t_0 <= -5e+85) tmp = t_1; elseif (t_0 <= 1e+308) tmp = fma(0.083333333333333, Float64(1.0 / x), Float64(Float64(log(x) - 1.0) * x)); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+85], t$95$1, If[LessEqual[t$95$0, 1e+308], N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\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)\\
t_1 := \left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+308}:\\
\;\;\;\;\mathsf{fma}\left(0.083333333333333, \frac{1}{x}, \left(\log x - 1\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)) < -5.0000000000000001e85 or 1e308 < (+.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 83.5%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.0
Applied rewrites63.0%
Applied rewrites66.4%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.4
Applied rewrites86.4%
if -5.0000000000000001e85 < (+.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)) < 1e308Initial program 99.4%
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
lower-/.f6499.4
lift-+.f64N/A
Applied rewrites99.5%
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.f6497.9
Applied rewrites97.9%
Taylor expanded in z around 0
Applied rewrites86.6%
Final simplification86.5%
(FPCore (x y z)
:precision binary64
(if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 4e+287)
(fma
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
(/ 1.0 x)
(* (- (log x) 1.0) x))
(* (* (/ (+ y 0.0007936500793651) x) z) z)))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 4e+287) {
tmp = fma(fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), (1.0 / x), ((log(x) - 1.0) * x));
} else {
tmp = (((y + 0.0007936500793651) / x) * z) * z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 4e+287) tmp = fma(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), Float64(1.0 / x), Float64(Float64(log(x) - 1.0) * x)); else tmp = Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * z) * z); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 4e+287], N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 4 \cdot 10^{+287}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right), \frac{1}{x}, \left(\log x - 1\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \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) < 4.0000000000000003e287Initial program 97.5%
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
lower-/.f6497.6
lift-+.f64N/A
Applied rewrites97.6%
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.f6496.4
Applied rewrites96.4%
if 4.0000000000000003e287 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 77.1%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6478.1
Applied rewrites78.1%
Applied rewrites78.1%
Applied rewrites87.2%
Final simplification94.4%
(FPCore (x y z)
:precision binary64
(if (<= x 950000000000.0)
(fma
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
(/ 1.0 x)
(fma (log x) (- x 0.5) (- 0.91893853320467 x)))
(+
(* (* (/ (+ y 0.0007936500793651) x) z) z)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 950000000000.0) {
tmp = fma(fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), (1.0 / x), fma(log(x), (x - 0.5), (0.91893853320467 - x)));
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 950000000000.0) tmp = fma(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), Float64(1.0 / x), fma(log(x), Float64(x - 0.5), Float64(0.91893853320467 - x))); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * 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, 950000000000.0], N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $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 950000000000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right), \frac{1}{x}, \mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 9.5e11Initial program 99.6%
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
lower-/.f6499.6
lift-+.f64N/A
Applied rewrites99.7%
if 9.5e11 < x Initial program 87.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.1
Applied rewrites81.1%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(if (<= x 900000000000.0)
(fma
(- x 0.5)
(log x)
(-
(+
(/
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
x)
0.91893853320467)
x))
(+
(* (* (/ (+ y 0.0007936500793651) x) z) z)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 900000000000.0) {
tmp = fma((x - 0.5), log(x), (((fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333) / x) + 0.91893853320467) - x));
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 900000000000.0) tmp = fma(Float64(x - 0.5), log(x), Float64(Float64(Float64(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333) / x) + 0.91893853320467) - x)); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * 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, 900000000000.0], N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(N[(N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $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 900000000000:\\
\;\;\;\;\mathsf{fma}\left(x - 0.5, \log x, \left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} + 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 9e11Initial program 99.6%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
if 9e11 < x Initial program 87.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.1
Applied rewrites81.1%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 0.029)
(fma
(fma
(fma z (+ y 0.0007936500793651) -0.0027777777777778)
z
0.083333333333333)
(/ 1.0 x)
(* (- (log x) 1.0) x))
(+
(* (* (/ (+ y 0.0007936500793651) x) z) z)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.029) {
tmp = fma(fma(fma(z, (y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), (1.0 / x), ((log(x) - 1.0) * x));
} else {
tmp = ((((y + 0.0007936500793651) / x) * z) * z) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.029) tmp = fma(fma(fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), z, 0.083333333333333), Float64(1.0 / x), Float64(Float64(log(x) - 1.0) * x)); else tmp = Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) / x) * 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, 0.029], N[(N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] * N[(1.0 / x), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision] * z), $MachinePrecision] * z), $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 0.029:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), z, 0.083333333333333\right), \frac{1}{x}, \left(\log x - 1\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y + 0.0007936500793651}{x} \cdot z\right) \cdot z + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 0.0290000000000000015Initial program 99.6%
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
lower-/.f6499.7
lift-+.f64N/A
Applied rewrites99.7%
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.f6499.1
Applied rewrites99.1%
if 0.0290000000000000015 < x Initial program 87.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.4
Applied rewrites81.4%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-/l*N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6499.3
Applied rewrites99.3%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(if (<= x 1250.0)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(+ (* (* z z) (/ y x)) (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1250.0) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((z * z) * (y / x)) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1250.0) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z * z) * Float64(y / x)) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1250.0], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z * z), $MachinePrecision] * N[(y / x), $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 1250:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{y}{x} + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 1250Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
if 1250 < x Initial program 87.9%
Taylor expanded in z around inf
Applied rewrites80.6%
Taylor expanded in y around inf
Applied rewrites84.5%
Final simplification90.9%
(FPCore (x y z)
:precision binary64
(if (<= x 14500000000000.0)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(+ (* (- (log x) 1.0) x) (* (* z z) (/ y x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 14500000000000.0) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((log(x) - 1.0) * x) + ((z * z) * (y / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 14500000000000.0) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(log(x) - 1.0) * x) + Float64(Float64(z * z) * Float64(y / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 14500000000000.0], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 14500000000000:\\
\;\;\;\;\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 + \left(z \cdot z\right) \cdot \frac{y}{x}\\
\end{array}
\end{array}
if x < 1.45e13Initial program 99.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6496.0
Applied rewrites96.0%
if 1.45e13 < x Initial program 87.3%
Taylor expanded in z around inf
Applied rewrites81.9%
Taylor expanded in y around inf
Applied rewrites85.4%
Taylor expanded in x around inf
*-commutativeN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6485.4
Applied rewrites85.4%
Final simplification90.4%
(FPCore (x y z)
:precision binary64
(if (<= x 6.8e+44)
(/
(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 <= 6.8e+44) {
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 <= 6.8e+44) 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, 6.8e+44], 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 6.8 \cdot 10^{+44}:\\
\;\;\;\;\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 < 6.8e44Initial program 98.3%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6490.9
Applied rewrites90.9%
if 6.8e44 < x Initial program 87.1%
Taylor expanded in x around inf
*-commutativeN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6474.6
Applied rewrites74.6%
(FPCore (x y z)
:precision binary64
(if (<= (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 2e+85)
(/
(fma
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (* (/ z x) z) (+ y 0.0007936500793651))))
double code(double x, double y, double z) {
double tmp;
if (((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 2e+85) {
tmp = fma(fma((y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((z / x) * z) * (y + 0.0007936500793651);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 2e+85) tmp = Float64(fma(fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 2e+85], N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z \leq 2 \cdot 10^{+85}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 2e85Initial program 97.0%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
if 2e85 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 86.7%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.8
Applied rewrites44.8%
Applied rewrites48.3%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6474.7
Applied rewrites74.7%
Final simplification61.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (* (/ z x) z) y)))
(if (<= (+ y 0.0007936500793651) -2000.0)
t_0
(if (<= (+ y 0.0007936500793651) 0.001)
(* (* (/ 0.0007936500793651 x) z) z)
t_0))))
double code(double x, double y, double z) {
double t_0 = ((z / x) * z) * y;
double tmp;
if ((y + 0.0007936500793651) <= -2000.0) {
tmp = t_0;
} else if ((y + 0.0007936500793651) <= 0.001) {
tmp = ((0.0007936500793651 / x) * z) * z;
} 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 = ((z / x) * z) * y
if ((y + 0.0007936500793651d0) <= (-2000.0d0)) then
tmp = t_0
else if ((y + 0.0007936500793651d0) <= 0.001d0) then
tmp = ((0.0007936500793651d0 / x) * z) * z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((z / x) * z) * y;
double tmp;
if ((y + 0.0007936500793651) <= -2000.0) {
tmp = t_0;
} else if ((y + 0.0007936500793651) <= 0.001) {
tmp = ((0.0007936500793651 / x) * z) * z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((z / x) * z) * y tmp = 0 if (y + 0.0007936500793651) <= -2000.0: tmp = t_0 elif (y + 0.0007936500793651) <= 0.001: tmp = ((0.0007936500793651 / x) * z) * z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(z / x) * z) * y) tmp = 0.0 if (Float64(y + 0.0007936500793651) <= -2000.0) tmp = t_0; elseif (Float64(y + 0.0007936500793651) <= 0.001) tmp = Float64(Float64(Float64(0.0007936500793651 / x) * z) * z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((z / x) * z) * y; tmp = 0.0; if ((y + 0.0007936500793651) <= -2000.0) tmp = t_0; elseif ((y + 0.0007936500793651) <= 0.001) tmp = ((0.0007936500793651 / x) * z) * z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], -2000.0], t$95$0, If[LessEqual[N[(y + 0.0007936500793651), $MachinePrecision], 0.001], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{z}{x} \cdot z\right) \cdot y\\
\mathbf{if}\;y + 0.0007936500793651 \leq -2000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y + 0.0007936500793651 \leq 0.001:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} \cdot z\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < -2e3 or 1e-3 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) Initial program 90.7%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6446.6
Applied rewrites46.6%
Applied rewrites47.1%
Applied rewrites47.6%
if -2e3 < (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) < 1e-3Initial program 95.3%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6434.6
Applied rewrites34.6%
Taylor expanded in y around 0
Applied rewrites37.9%
Final simplification42.7%
(FPCore (x y z) :precision binary64 (* (* (/ z x) z) (+ y 0.0007936500793651)))
double code(double x, double y, double z) {
return ((z / x) * z) * (y + 0.0007936500793651);
}
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 + 0.0007936500793651d0)
end function
public static double code(double x, double y, double z) {
return ((z / x) * z) * (y + 0.0007936500793651);
}
def code(x, y, z): return ((z / x) * z) * (y + 0.0007936500793651)
function code(x, y, z) return Float64(Float64(Float64(z / x) * z) * Float64(y + 0.0007936500793651)) end
function tmp = code(x, y, z) tmp = ((z / x) * z) * (y + 0.0007936500793651); end
code[x_, y_, z_] := N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{z}{x} \cdot z\right) \cdot \left(y + 0.0007936500793651\right)
\end{array}
Initial program 93.1%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.7
Applied rewrites29.7%
Applied rewrites31.1%
Taylor expanded in z around inf
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
distribute-rgt-outN/A
lower-*.f64N/A
unpow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6442.8
Applied rewrites42.8%
Final simplification42.8%
(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 93.1%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6439.3
Applied rewrites39.3%
Taylor expanded in x around 0
Applied rewrites40.6%
(FPCore (x y z) :precision binary64 (* (* (/ 0.0007936500793651 x) z) z))
double code(double x, double y, double z) {
return ((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 = ((0.0007936500793651d0 / x) * z) * z
end function
public static double code(double x, double y, double z) {
return ((0.0007936500793651 / x) * z) * z;
}
def code(x, y, z): return ((0.0007936500793651 / x) * z) * z
function code(x, y, z) return Float64(Float64(Float64(0.0007936500793651 / x) * z) * z) end
function tmp = code(x, y, z) tmp = ((0.0007936500793651 / x) * z) * z; end
code[x_, y_, z_] := N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] * z), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{0.0007936500793651}{x} \cdot z\right) \cdot z
\end{array}
Initial program 93.1%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6439.3
Applied rewrites39.3%
Taylor expanded in y around 0
Applied rewrites26.1%
(FPCore (x y z) :precision binary64 (* (* (/ z x) 0.0007936500793651) z))
double code(double x, double y, double z) {
return ((z / x) * 0.0007936500793651) * z;
}
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) * 0.0007936500793651d0) * z
end function
public static double code(double x, double y, double z) {
return ((z / x) * 0.0007936500793651) * z;
}
def code(x, y, z): return ((z / x) * 0.0007936500793651) * z
function code(x, y, z) return Float64(Float64(Float64(z / x) * 0.0007936500793651) * z) end
function tmp = code(x, y, z) tmp = ((z / x) * 0.0007936500793651) * z; end
code[x_, y_, z_] := N[(N[(N[(z / x), $MachinePrecision] * 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{z}{x} \cdot 0.0007936500793651\right) \cdot z
\end{array}
Initial program 93.1%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6439.3
Applied rewrites39.3%
Taylor expanded in y around 0
Applied rewrites26.1%
Applied rewrites26.1%
Final simplification26.1%
(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 2024235
(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)))