
(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 16 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 650000.0)
(+
(/
(+
0.083333333333333
(* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z))
x)
(/
(-
(* (+ 0.91893853320467 x) (* (log x) (fma x x -0.25)))
(* (- (* x x) 0.8444480278083504) (+ 0.5 x)))
(* (+ 0.5 x) (+ 0.91893853320467 x))))
(+
(* (* (/ z x) z) (+ 0.0007936500793651 y))
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 650000.0) {
tmp = ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x) + ((((0.91893853320467 + x) * (log(x) * fma(x, x, -0.25))) - (((x * x) - 0.8444480278083504) * (0.5 + x))) / ((0.5 + x) * (0.91893853320467 + x)));
} else {
tmp = (((z / x) * z) * (0.0007936500793651 + y)) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 650000.0) tmp = Float64(Float64(Float64(0.083333333333333 + Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x) + Float64(Float64(Float64(Float64(0.91893853320467 + x) * Float64(log(x) * fma(x, x, -0.25))) - Float64(Float64(Float64(x * x) - 0.8444480278083504) * Float64(0.5 + x))) / Float64(Float64(0.5 + x) * Float64(0.91893853320467 + x)))); else tmp = Float64(Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 650000.0], N[(N[(N[(0.083333333333333 + N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(N[(0.91893853320467 + x), $MachinePrecision] * N[(N[Log[x], $MachinePrecision] * N[(x * x + -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x * x), $MachinePrecision] - 0.8444480278083504), $MachinePrecision] * N[(0.5 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 + x), $MachinePrecision] * N[(0.91893853320467 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $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 650000:\\
\;\;\;\;\frac{0.083333333333333 + \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z}{x} + \frac{\left(0.91893853320467 + x\right) \cdot \left(\log x \cdot \mathsf{fma}\left(x, x, -0.25\right)\right) - \left(x \cdot x - 0.8444480278083504\right) \cdot \left(0.5 + x\right)}{\left(0.5 + x\right) \cdot \left(0.91893853320467 + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right) + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 6.5e5Initial program 99.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
flip--N/A
frac-subN/A
lower-/.f64N/A
Applied rewrites99.7%
if 6.5e5 < x Initial program 83.8%
Taylor expanded in z around 0
Applied rewrites63.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6488.5
Applied rewrites88.5%
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z))
x))))
(if (<= t_0 -4e+125)
(* (+ (/ 0.0007936500793651 x) (/ y x)) (* z z))
(if (<= t_0 5e+301)
(fma
(- x 0.5)
(log x)
(- (+ (/ 0.083333333333333 x) 0.91893853320467) x))
(* (* (/ z x) z) (+ 0.0007936500793651 y))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x);
double tmp;
if (t_0 <= -4e+125) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (t_0 <= 5e+301) {
tmp = fma((x - 0.5), log(x), (((0.083333333333333 / x) + 0.91893853320467) - x));
} else {
tmp = ((z / x) * z) * (0.0007936500793651 + y);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x)) tmp = 0.0 if (t_0 <= -4e+125) tmp = Float64(Float64(Float64(0.0007936500793651 / x) + Float64(y / x)) * Float64(z * z)); elseif (t_0 <= 5e+301) tmp = fma(Float64(x - 0.5), log(x), Float64(Float64(Float64(0.083333333333333 / x) + 0.91893853320467) - x)); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+125], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+301], 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[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z}{x}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{+125}:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\mathsf{fma}\left(x - 0.5, \log x, \left(\frac{0.083333333333333}{x} + 0.91893853320467\right) - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right)\\
\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)) < -3.9999999999999997e125Initial program 91.2%
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-/.f6498.3
Applied rewrites98.3%
if -3.9999999999999997e125 < (+.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.0000000000000004e301Initial 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-/.f6487.3
Applied rewrites87.3%
if 5.0000000000000004e301 < (+.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 81.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.3
Applied rewrites57.3%
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
associate-+l+N/A
Applied rewrites99.8%
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-+.f6490.3
Applied rewrites90.3%
Final simplification89.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z))
x))))
(if (<= t_0 -4e+125)
(* (+ (/ 0.0007936500793651 x) (/ y x)) (* z z))
(if (<= t_0 5e+301)
(+
(fma (- x 0.5) (log x) 0.91893853320467)
(- (/ 0.083333333333333 x) x))
(* (* (/ z x) z) (+ 0.0007936500793651 y))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x);
double tmp;
if (t_0 <= -4e+125) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (t_0 <= 5e+301) {
tmp = fma((x - 0.5), log(x), 0.91893853320467) + ((0.083333333333333 / x) - x);
} else {
tmp = ((z / x) * z) * (0.0007936500793651 + y);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x)) tmp = 0.0 if (t_0 <= -4e+125) tmp = Float64(Float64(Float64(0.0007936500793651 / x) + Float64(y / x)) * Float64(z * z)); elseif (t_0 <= 5e+301) tmp = Float64(fma(Float64(x - 0.5), log(x), 0.91893853320467) + Float64(Float64(0.083333333333333 / x) - x)); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+125], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+301], N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z}{x}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{+125}:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\mathsf{fma}\left(x - 0.5, \log x, 0.91893853320467\right) + \left(\frac{0.083333333333333}{x} - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right)\\
\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)) < -3.9999999999999997e125Initial program 91.2%
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-/.f6498.3
Applied rewrites98.3%
if -3.9999999999999997e125 < (+.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.0000000000000004e301Initial program 99.4%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f648.9
Applied rewrites8.9%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
sub-negN/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6487.2
Applied rewrites87.2%
if 5.0000000000000004e301 < (+.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 81.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.3
Applied rewrites57.3%
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
associate-+l+N/A
Applied rewrites99.8%
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-+.f6490.3
Applied rewrites90.3%
Final simplification89.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z))
x))))
(if (<= t_0 -4e+125)
(* (+ (/ 0.0007936500793651 x) (/ y x)) (* z z))
(if (<= t_0 5e+301)
(+ (/ 0.083333333333333 x) (+ (- (* (log x) x) x) 0.91893853320467))
(* (* (/ z x) z) (+ 0.0007936500793651 y))))))
double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x);
double tmp;
if (t_0 <= -4e+125) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (t_0 <= 5e+301) {
tmp = (0.083333333333333 / x) + (((log(x) * x) - x) + 0.91893853320467);
} else {
tmp = ((z / x) * z) * (0.0007936500793651 + y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((0.083333333333333d0 + (((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0) * z)) / x)
if (t_0 <= (-4d+125)) then
tmp = ((0.0007936500793651d0 / x) + (y / x)) * (z * z)
else if (t_0 <= 5d+301) then
tmp = (0.083333333333333d0 / x) + (((log(x) * x) - x) + 0.91893853320467d0)
else
tmp = ((z / x) * z) * (0.0007936500793651d0 + y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x);
double tmp;
if (t_0 <= -4e+125) {
tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z);
} else if (t_0 <= 5e+301) {
tmp = (0.083333333333333 / x) + (((Math.log(x) * x) - x) + 0.91893853320467);
} else {
tmp = ((z / x) * z) * (0.0007936500793651 + y);
}
return tmp;
}
def code(x, y, z): t_0 = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x) tmp = 0 if t_0 <= -4e+125: tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z) elif t_0 <= 5e+301: tmp = (0.083333333333333 / x) + (((math.log(x) * x) - x) + 0.91893853320467) else: tmp = ((z / x) * z) * (0.0007936500793651 + y) return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x)) tmp = 0.0 if (t_0 <= -4e+125) tmp = Float64(Float64(Float64(0.0007936500793651 / x) + Float64(y / x)) * Float64(z * z)); elseif (t_0 <= 5e+301) tmp = Float64(Float64(0.083333333333333 / x) + Float64(Float64(Float64(log(x) * x) - x) + 0.91893853320467)); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x); tmp = 0.0; if (t_0 <= -4e+125) tmp = ((0.0007936500793651 / x) + (y / x)) * (z * z); elseif (t_0 <= 5e+301) tmp = (0.083333333333333 / x) + (((log(x) * x) - x) + 0.91893853320467); else tmp = ((z / x) * z) * (0.0007936500793651 + y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+125], N[(N[(N[(0.0007936500793651 / x), $MachinePrecision] + N[(y / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+301], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z}{x}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{+125}:\\
\;\;\;\;\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(\left(\log x \cdot x - x\right) + 0.91893853320467\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right)\\
\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)) < -3.9999999999999997e125Initial program 91.2%
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-/.f6498.3
Applied rewrites98.3%
if -3.9999999999999997e125 < (+.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.0000000000000004e301Initial program 99.4%
Taylor expanded in z around 0
Applied rewrites87.2%
Taylor expanded in x around inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6485.1
Applied rewrites85.1%
if 5.0000000000000004e301 < (+.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 81.2%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.3
Applied rewrites57.3%
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
associate-+l+N/A
Applied rewrites99.8%
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-+.f6490.3
Applied rewrites90.3%
Final simplification88.4%
(FPCore (x y z)
:precision binary64
(if (<= x 650000.0)
(+
(+ (- (/ (* (log x) (fma x x -0.25)) (+ 0.5 x)) x) 0.91893853320467)
(/
(+
0.083333333333333
(* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z))
x))
(+
(* (* (/ z x) z) (+ 0.0007936500793651 y))
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 650000.0) {
tmp = ((((log(x) * fma(x, x, -0.25)) / (0.5 + x)) - x) + 0.91893853320467) + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x);
} else {
tmp = (((z / x) * z) * (0.0007936500793651 + y)) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 650000.0) tmp = Float64(Float64(Float64(Float64(Float64(log(x) * fma(x, x, -0.25)) / Float64(0.5 + x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 + Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x)); else tmp = Float64(Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 650000.0], N[(N[(N[(N[(N[(N[Log[x], $MachinePrecision] * N[(x * x + -0.25), $MachinePrecision]), $MachinePrecision] / N[(0.5 + x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(0.083333333333333 + N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $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 650000:\\
\;\;\;\;\left(\left(\frac{\log x \cdot \mathsf{fma}\left(x, x, -0.25\right)}{0.5 + x} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right) + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 6.5e5Initial program 99.7%
lift-*.f64N/A
lift--.f64N/A
flip--N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
sub-negN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
if 6.5e5 < x Initial program 83.8%
Taylor expanded in z around 0
Applied rewrites63.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6488.5
Applied rewrites88.5%
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))
(if (<= x 650000.0)
(+
t_0
(/
(+
0.083333333333333
(* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z))
x))
(+ (* (* (/ z x) z) (+ 0.0007936500793651 y)) t_0))))
double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 650000.0) {
tmp = t_0 + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x);
} else {
tmp = (((z / x) * z) * (0.0007936500793651 + y)) + t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
if (x <= 650000.0d0) then
tmp = t_0 + ((0.083333333333333d0 + (((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0) * z)) / x)
else
tmp = (((z / x) * z) * (0.0007936500793651d0 + y)) + t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
double tmp;
if (x <= 650000.0) {
tmp = t_0 + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x);
} else {
tmp = (((z / x) * z) * (0.0007936500793651 + y)) + t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467 tmp = 0 if x <= 650000.0: tmp = t_0 + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x) else: tmp = (((z / x) * z) * (0.0007936500793651 + y)) + t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) tmp = 0.0 if (x <= 650000.0) tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x)); else tmp = Float64(Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)) + t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467; tmp = 0.0; if (x <= 650000.0) tmp = t_0 + ((0.083333333333333 + (((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z)) / x); else tmp = (((z / x) * z) * (0.0007936500793651 + y)) + t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, If[LessEqual[x, 650000.0], N[(t$95$0 + N[(N[(0.083333333333333 + N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
\mathbf{if}\;x \leq 650000:\\
\;\;\;\;t\_0 + \frac{0.083333333333333 + \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right) + t\_0\\
\end{array}
\end{array}
if x < 6.5e5Initial program 99.7%
if 6.5e5 < x Initial program 83.8%
Taylor expanded in z around 0
Applied rewrites63.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6488.5
Applied rewrites88.5%
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00043)
(/
(fma
(fma -0.5 (log x) 0.91893853320467)
x
(fma
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
z
0.083333333333333))
x)
(if (<= x 1.02e+183)
(+ (* (* z z) (/ (+ 0.0007936500793651 y) x)) (* (- (log x) 1.0) x))
(+
(* (* (/ z x) z) y)
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00043) {
tmp = fma(fma(-0.5, log(x), 0.91893853320467), x, fma(fma((0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else if (x <= 1.02e+183) {
tmp = ((z * z) * ((0.0007936500793651 + y) / x)) + ((log(x) - 1.0) * x);
} else {
tmp = (((z / x) * z) * y) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.00043) tmp = Float64(fma(fma(-0.5, log(x), 0.91893853320467), x, fma(fma(Float64(0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333)) / x); elseif (x <= 1.02e+183) tmp = Float64(Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x)) + Float64(Float64(log(x) - 1.0) * x)); else tmp = Float64(Float64(Float64(Float64(z / x) * z) * y) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.00043], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1.02e+183], N[(N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * y), $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.00043:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right), x, \mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+183}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x} + \left(\log x - 1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot y + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 4.29999999999999989e-4Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites99.3%
if 4.29999999999999989e-4 < x < 1.02000000000000002e183Initial program 91.6%
Taylor expanded in z around 0
Applied rewrites55.6%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6496.1
Applied rewrites96.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.f6495.4
Applied rewrites95.4%
if 1.02000000000000002e183 < x Initial program 69.8%
Taylor expanded in z around 0
Applied rewrites76.4%
Taylor expanded in y around inf
Applied rewrites85.5%
Taylor expanded in y around inf
Applied rewrites89.8%
Final simplification96.6%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00043)
(/
(fma
(fma -0.5 (log x) 0.91893853320467)
x
(fma
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
z
0.083333333333333))
x)
(+
(* (* (/ z x) z) (+ 0.0007936500793651 y))
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00043) {
tmp = fma(fma(-0.5, log(x), 0.91893853320467), x, fma(fma((0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else {
tmp = (((z / x) * z) * (0.0007936500793651 + y)) + ((((x - 0.5) * log(x)) - x) + 0.91893853320467);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.00043) tmp = Float64(fma(fma(-0.5, log(x), 0.91893853320467), x, fma(fma(Float64(0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333)) / x); else tmp = Float64(Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)) + Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.00043], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $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 0.00043:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right), x, \mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right) + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right)\\
\end{array}
\end{array}
if x < 4.29999999999999989e-4Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites99.3%
if 4.29999999999999989e-4 < x Initial program 84.4%
Taylor expanded in z around 0
Applied rewrites62.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6488.1
Applied rewrites88.1%
Applied rewrites98.8%
Final simplification99.1%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00043)
(/
(fma
(fma -0.5 (log x) 0.91893853320467)
x
(fma
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
z
0.083333333333333))
x)
(+ (* (* z z) (/ (+ 0.0007936500793651 y) x)) (* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00043) {
tmp = fma(fma(-0.5, log(x), 0.91893853320467), x, fma(fma((0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333)) / x;
} else {
tmp = ((z * z) * ((0.0007936500793651 + y) / x)) + ((log(x) - 1.0) * x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.00043) tmp = Float64(fma(fma(-0.5, log(x), 0.91893853320467), x, fma(fma(Float64(0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333)) / x); else tmp = Float64(Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x)) + Float64(Float64(log(x) - 1.0) * x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.00043], N[(N[(N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] * x + N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00043:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right), x, \mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), z, 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x} + \left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 4.29999999999999989e-4Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
Applied rewrites99.3%
if 4.29999999999999989e-4 < x Initial program 84.4%
Taylor expanded in z around 0
Applied rewrites62.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6488.1
Applied rewrites88.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.f6487.7
Applied rewrites87.7%
Final simplification93.8%
(FPCore (x y z)
:precision binary64
(if (<= x 0.00043)
(+
(/
(fma
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
z
0.083333333333333)
x)
(- 0.91893853320467 x))
(+ (* (* z z) (/ (+ 0.0007936500793651 y) x)) (* (- (log x) 1.0) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.00043) {
tmp = (fma(fma((0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333) / x) + (0.91893853320467 - x);
} else {
tmp = ((z * z) * ((0.0007936500793651 + y) / x)) + ((log(x) - 1.0) * x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.00043) tmp = Float64(Float64(fma(fma(Float64(0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333) / x) + Float64(0.91893853320467 - x)); else tmp = Float64(Float64(Float64(z * z) * Float64(Float64(0.0007936500793651 + y) / x)) + Float64(Float64(log(x) - 1.0) * x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.00043], N[(N[(N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * z), $MachinePrecision] * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] - 1.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00043:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x} + \left(0.91893853320467 - x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot z\right) \cdot \frac{0.0007936500793651 + y}{x} + \left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 4.29999999999999989e-4Initial program 99.7%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.4
Applied rewrites44.4%
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
associate-+l+N/A
Applied rewrites87.6%
Taylor expanded in x around 0
Applied rewrites98.6%
if 4.29999999999999989e-4 < x Initial program 84.4%
Taylor expanded in z around 0
Applied rewrites62.4%
Taylor expanded in z around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
unpow2N/A
lower-*.f6488.1
Applied rewrites88.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.f6487.7
Applied rewrites87.7%
Final simplification93.5%
(FPCore (x y z)
:precision binary64
(if (<= x 3.7e+28)
(/
(fma
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (- (log x) 1.0) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.7e+28) {
tmp = fma(fma((0.0007936500793651 + y), 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 <= 3.7e+28) tmp = Float64(fma(fma(Float64(0.0007936500793651 + y), 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, 3.7e+28], N[(N[(N[(N[(0.0007936500793651 + y), $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 3.7 \cdot 10^{+28}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\log x - 1\right) \cdot x\\
\end{array}
\end{array}
if x < 3.6999999999999999e28Initial program 99.7%
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.2
Applied rewrites96.2%
if 3.6999999999999999e28 < x Initial program 82.7%
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.f6465.6
Applied rewrites65.6%
Final simplification83.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ z x) z)))
(if (<= (* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z) 5.0)
(fma t_0 y (/ 1.0 (* 12.000000000000048 x)))
(* t_0 (+ 0.0007936500793651 y)))))
double code(double x, double y, double z) {
double t_0 = (z / x) * z;
double tmp;
if ((((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z) <= 5.0) {
tmp = fma(t_0, y, (1.0 / (12.000000000000048 * x)));
} else {
tmp = t_0 * (0.0007936500793651 + y);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(z / x) * z) tmp = 0.0 if (Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z) <= 5.0) tmp = fma(t_0, y, Float64(1.0 / Float64(12.000000000000048 * x))); else tmp = Float64(t_0 * Float64(0.0007936500793651 + y)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 5.0], N[(t$95$0 * y + N[(1.0 / N[(12.000000000000048 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z}{x} \cdot z\\
\mathbf{if}\;\left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z \leq 5:\\
\;\;\;\;\mathsf{fma}\left(t\_0, y, \frac{1}{12.000000000000048 \cdot x}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(0.0007936500793651 + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5Initial program 97.5%
Taylor expanded in y around inf
Applied rewrites91.5%
Taylor expanded in y around inf
Applied rewrites65.3%
Applied rewrites65.3%
if 5 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 86.8%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.8
Applied rewrites47.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
associate-+l+N/A
Applied rewrites99.7%
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-+.f6476.7
Applied rewrites76.7%
Final simplification70.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ z x) z)))
(if (<= (* (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778) z) 5.0)
(fma t_0 y (/ 0.083333333333333 x))
(* t_0 (+ 0.0007936500793651 y)))))
double code(double x, double y, double z) {
double t_0 = (z / x) * z;
double tmp;
if ((((z * (0.0007936500793651 + y)) - 0.0027777777777778) * z) <= 5.0) {
tmp = fma(t_0, y, (0.083333333333333 / x));
} else {
tmp = t_0 * (0.0007936500793651 + y);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(z / x) * z) tmp = 0.0 if (Float64(Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778) * z) <= 5.0) tmp = fma(t_0, y, Float64(0.083333333333333 / x)); else tmp = Float64(t_0 * Float64(0.0007936500793651 + y)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision], 5.0], N[(t$95$0 * y + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{z}{x} \cdot z\\
\mathbf{if}\;\left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z \leq 5:\\
\;\;\;\;\mathsf{fma}\left(t\_0, y, \frac{0.083333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(0.0007936500793651 + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 5Initial program 97.5%
Taylor expanded in y around inf
Applied rewrites91.5%
Taylor expanded in y around inf
Applied rewrites65.3%
if 5 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 86.8%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.8
Applied rewrites47.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
associate-+l+N/A
Applied rewrites99.7%
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-+.f6476.7
Applied rewrites76.7%
Final simplification70.7%
(FPCore (x y z)
:precision binary64
(if (<= x 1.25e+60)
(/
(fma
(fma (+ 0.0007936500793651 y) z -0.0027777777777778)
z
0.083333333333333)
x)
(* (* (/ z x) z) (+ 0.0007936500793651 y))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.25e+60) {
tmp = fma(fma((0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333) / x;
} else {
tmp = ((z / x) * z) * (0.0007936500793651 + y);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.25e+60) tmp = Float64(fma(fma(Float64(0.0007936500793651 + y), z, -0.0027777777777778), z, 0.083333333333333) / x); else tmp = Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.25e+60], N[(N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] * z + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.25 \cdot 10^{+60}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0007936500793651 + y, z, -0.0027777777777778\right), z, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right)\\
\end{array}
\end{array}
if x < 1.24999999999999994e60Initial program 99.7%
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-+.f6492.1
Applied rewrites92.1%
if 1.24999999999999994e60 < x Initial program 81.6%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6422.0
Applied rewrites22.0%
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
associate-+l+N/A
Applied rewrites99.5%
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-+.f6438.2
Applied rewrites38.2%
Final simplification70.6%
(FPCore (x y z) :precision binary64 (* (* (/ z x) z) (+ 0.0007936500793651 y)))
double code(double x, double y, double z) {
return ((z / x) * z) * (0.0007936500793651 + 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) * (0.0007936500793651d0 + y)
end function
public static double code(double x, double y, double z) {
return ((z / x) * z) * (0.0007936500793651 + y);
}
def code(x, y, z): return ((z / x) * z) * (0.0007936500793651 + y)
function code(x, y, z) return Float64(Float64(Float64(z / x) * z) * Float64(0.0007936500793651 + y)) end
function tmp = code(x, y, z) tmp = ((z / x) * z) * (0.0007936500793651 + y); end
code[x_, y_, z_] := N[(N[(N[(z / x), $MachinePrecision] * z), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{z}{x} \cdot z\right) \cdot \left(0.0007936500793651 + y\right)
\end{array}
Initial program 92.5%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6434.7
Applied rewrites34.7%
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
associate-+l+N/A
Applied rewrites93.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-+.f6449.4
Applied rewrites49.4%
Final simplification49.4%
(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 92.5%
Taylor expanded in y around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6434.7
Applied rewrites34.7%
Applied rewrites38.5%
Final simplification38.5%
(FPCore (x y z) :precision binary64 (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((((x - 0.5d0) * log(x)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z): return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) end
function tmp = code(x, y, z) tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)); end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}
herbie shell --seed 2024268
(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)))