
(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 45000000000000.0)
(/
(fma
x
(+ 0.91893853320467 (fma (log x) (+ x -0.5) (- x)))
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333))
x)
(+ (- (* x (log x)) x) (* z (* z (/ (+ 0.0007936500793651 y) x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 45000000000000.0) {
tmp = fma(x, (0.91893853320467 + fma(log(x), (x + -0.5), -x)), fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333)) / x;
} else {
tmp = ((x * log(x)) - x) + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 45000000000000.0) tmp = Float64(fma(x, Float64(0.91893853320467 + fma(log(x), Float64(x + -0.5), Float64(-x))), fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333)) / x); else tmp = Float64(Float64(Float64(x * log(x)) - x) + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 45000000000000.0], N[(N[(x * N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 45000000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, 0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, -x\right), \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log x - x\right) + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 4.5e13Initial program 99.7%
Taylor expanded in x around 0
Simplified99.7%
if 4.5e13 < x Initial program 84.9%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6499.6
Simplified99.6%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6499.6
Simplified99.6%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (<=
(-
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
(/
(-
(* z (- 0.0027777777777778 (* z (+ 0.0007936500793651 y))))
0.083333333333333)
x))
-5e+141)
(* z (* y (/ z x)))
(/
(fma z (fma z 0.0007936500793651 -0.0027777777777778) 0.083333333333333)
x)))
double code(double x, double y, double z) {
double tmp;
if (((0.91893853320467 + ((log(x) * (x - 0.5)) - x)) - (((z * (0.0027777777777778 - (z * (0.0007936500793651 + y)))) - 0.083333333333333) / x)) <= -5e+141) {
tmp = z * (y * (z / x));
} else {
tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) - Float64(Float64(Float64(z * Float64(0.0027777777777778 - Float64(z * Float64(0.0007936500793651 + y)))) - 0.083333333333333) / x)) <= -5e+141) tmp = Float64(z * Float64(y * Float64(z / x))); else tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z * N[(0.0027777777777778 - N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], -5e+141], N[(z * N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) - \frac{z \cdot \left(0.0027777777777778 - z \cdot \left(0.0007936500793651 + y\right)\right) - 0.083333333333333}{x} \leq -5 \cdot 10^{+141}:\\
\;\;\;\;z \cdot \left(y \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\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.00000000000000025e141Initial program 90.5%
Taylor expanded in y around inf
Simplified99.9%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Simplified92.6%
Taylor expanded in y around inf
lower-/.f6492.6
Simplified92.6%
if -5.00000000000000025e141 < (+.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 94.1%
Taylor expanded in y around inf
Simplified88.9%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified63.6%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6457.5
Simplified57.5%
Final simplification63.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -5e-14)
(fma
y
(* (/ z x) (+ z (/ (fma z 0.0007936500793651 -0.0027777777777778) y)))
(/ 0.083333333333333 x))
(if (<= t_0 5e-15)
(+
(/ 0.083333333333333 x)
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))
(*
z
(fma
z
(* (/ 1.0 (* x z)) (- (/ 0.083333333333333 z) 0.0027777777777778))
(* (+ 0.0007936500793651 y) (/ z x))))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e-14) {
tmp = fma(y, ((z / x) * (z + (fma(z, 0.0007936500793651, -0.0027777777777778) / y))), (0.083333333333333 / x));
} else if (t_0 <= 5e-15) {
tmp = (0.083333333333333 / x) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
} else {
tmp = z * fma(z, ((1.0 / (x * z)) * ((0.083333333333333 / z) - 0.0027777777777778)), ((0.0007936500793651 + y) * (z / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -5e-14) tmp = fma(y, Float64(Float64(z / x) * Float64(z + Float64(fma(z, 0.0007936500793651, -0.0027777777777778) / y))), Float64(0.083333333333333 / x)); elseif (t_0 <= 5e-15) tmp = Float64(Float64(0.083333333333333 / x) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))); else tmp = Float64(z * fma(z, Float64(Float64(1.0 / Float64(x * z)) * Float64(Float64(0.083333333333333 / z) - 0.0027777777777778)), Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-14], N[(y * N[(N[(z / x), $MachinePrecision] * N[(z + N[(N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-15], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision] * N[(N[(0.083333333333333 / z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{x} \cdot \left(z + \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{y}\right), \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(z, \frac{1}{x \cdot z} \cdot \left(\frac{0.083333333333333}{z} - 0.0027777777777778\right), \left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.0000000000000002e-14Initial program 91.3%
Taylor expanded in y around inf
Simplified99.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6488.6
Simplified88.6%
if -5.0000000000000002e-14 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 4.99999999999999999e-15Initial program 99.5%
Taylor expanded in z around 0
Simplified99.5%
if 4.99999999999999999e-15 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 87.3%
Taylor expanded in y around inf
Simplified82.4%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified74.4%
Taylor expanded in z around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified75.6%
Taylor expanded in z around -inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-lft-inN/A
lower-fma.f64N/A
Simplified80.9%
Final simplification90.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -5e-14)
(fma
y
(* (/ z x) (+ z (/ (fma z 0.0007936500793651 -0.0027777777777778) y)))
(/ 0.083333333333333 x))
(if (<= t_0 5e-15)
(+
0.91893853320467
(fma (log x) (+ x -0.5) (- (/ 0.083333333333333 x) x)))
(*
z
(fma
z
(* (/ 1.0 (* x z)) (- (/ 0.083333333333333 z) 0.0027777777777778))
(* (+ 0.0007936500793651 y) (/ z x))))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e-14) {
tmp = fma(y, ((z / x) * (z + (fma(z, 0.0007936500793651, -0.0027777777777778) / y))), (0.083333333333333 / x));
} else if (t_0 <= 5e-15) {
tmp = 0.91893853320467 + fma(log(x), (x + -0.5), ((0.083333333333333 / x) - x));
} else {
tmp = z * fma(z, ((1.0 / (x * z)) * ((0.083333333333333 / z) - 0.0027777777777778)), ((0.0007936500793651 + y) * (z / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -5e-14) tmp = fma(y, Float64(Float64(z / x) * Float64(z + Float64(fma(z, 0.0007936500793651, -0.0027777777777778) / y))), Float64(0.083333333333333 / x)); elseif (t_0 <= 5e-15) tmp = Float64(0.91893853320467 + fma(log(x), Float64(x + -0.5), Float64(Float64(0.083333333333333 / x) - x))); else tmp = Float64(z * fma(z, Float64(Float64(1.0 / Float64(x * z)) * Float64(Float64(0.083333333333333 / z) - 0.0027777777777778)), Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-14], N[(y * N[(N[(z / x), $MachinePrecision] * N[(z + N[(N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-15], N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(N[(1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision] * N[(N[(0.083333333333333 / z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{x} \cdot \left(z + \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{y}\right), \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-15}:\\
\;\;\;\;0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x} - x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(z, \frac{1}{x \cdot z} \cdot \left(\frac{0.083333333333333}{z} - 0.0027777777777778\right), \left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.0000000000000002e-14Initial program 91.3%
Taylor expanded in y around inf
Simplified99.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6488.6
Simplified88.6%
if -5.0000000000000002e-14 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 4.99999999999999999e-15Initial program 99.5%
Taylor expanded in z around 0
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
associate--l+N/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower--.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6499.5
Simplified99.5%
if 4.99999999999999999e-15 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 87.3%
Taylor expanded in y around inf
Simplified82.4%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified74.4%
Taylor expanded in z around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified75.6%
Taylor expanded in z around -inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-lft-inN/A
lower-fma.f64N/A
Simplified80.9%
Final simplification90.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778))))
(if (<= t_0 -5e-14)
(fma
y
(* (/ z x) (+ z (/ (fma z 0.0007936500793651 -0.0027777777777778) y)))
(/ 0.083333333333333 x))
(if (<= t_0 5e-15)
(- (fma (log x) (+ x -0.5) (/ 0.083333333333333 x)) x)
(*
z
(fma
z
(* (/ 1.0 (* x z)) (- (/ 0.083333333333333 z) 0.0027777777777778))
(* (+ 0.0007936500793651 y) (/ z x))))))))
double code(double x, double y, double z) {
double t_0 = z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778);
double tmp;
if (t_0 <= -5e-14) {
tmp = fma(y, ((z / x) * (z + (fma(z, 0.0007936500793651, -0.0027777777777778) / y))), (0.083333333333333 / x));
} else if (t_0 <= 5e-15) {
tmp = fma(log(x), (x + -0.5), (0.083333333333333 / x)) - x;
} else {
tmp = z * fma(z, ((1.0 / (x * z)) * ((0.083333333333333 / z) - 0.0027777777777778)), ((0.0007936500793651 + y) * (z / x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) tmp = 0.0 if (t_0 <= -5e-14) tmp = fma(y, Float64(Float64(z / x) * Float64(z + Float64(fma(z, 0.0007936500793651, -0.0027777777777778) / y))), Float64(0.083333333333333 / x)); elseif (t_0 <= 5e-15) tmp = Float64(fma(log(x), Float64(x + -0.5), Float64(0.083333333333333 / x)) - x); else tmp = Float64(z * fma(z, Float64(Float64(1.0 / Float64(x * z)) * Float64(Float64(0.083333333333333 / z) - 0.0027777777777778)), Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-14], N[(y * N[(N[(z / x), $MachinePrecision] * N[(z + N[(N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-15], N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(z * N[(z * N[(N[(1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision] * N[(N[(0.083333333333333 / z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{x} \cdot \left(z + \frac{\mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)}{y}\right), \frac{0.083333333333333}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x}\right) - x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(z, \frac{1}{x \cdot z} \cdot \left(\frac{0.083333333333333}{z} - 0.0027777777777778\right), \left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < -5.0000000000000002e-14Initial program 91.3%
Taylor expanded in y around inf
Simplified99.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
associate--l+N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-subN/A
lower-+.f64N/A
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6488.6
Simplified88.6%
if -5.0000000000000002e-14 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) < 4.99999999999999999e-15Initial program 99.5%
Taylor expanded in y around inf
Simplified93.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f6499.5
Simplified99.5%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6496.3
Simplified96.3%
if 4.99999999999999999e-15 < (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) Initial program 87.3%
Taylor expanded in y around inf
Simplified82.4%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified74.4%
Taylor expanded in z around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified75.6%
Taylor expanded in z around -inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-lft-inN/A
lower-fma.f64N/A
Simplified80.9%
Final simplification89.3%
(FPCore (x y z)
:precision binary64
(if (<= x 0.19)
(+
0.91893853320467
(fma
-0.5
(log x)
(fma
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
(/ z x)
(/ 0.083333333333333 x))))
(+
(* z (* z (/ (+ 0.0007936500793651 y) x)))
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.19) {
tmp = 0.91893853320467 + fma(-0.5, log(x), fma(fma(z, (0.0007936500793651 + y), -0.0027777777777778), (z / x), (0.083333333333333 / x)));
} else {
tmp = (z * (z * ((0.0007936500793651 + y) / x))) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.19) tmp = Float64(0.91893853320467 + fma(-0.5, log(x), fma(fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), Float64(z / x), Float64(0.083333333333333 / x)))); else tmp = Float64(Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x))) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.19], N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision] + N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.19:\\
\;\;\;\;0.91893853320467 + \mathsf{fma}\left(-0.5, \log x, \mathsf{fma}\left(\mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \frac{z}{x}, \frac{0.083333333333333}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right) + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\end{array}
\end{array}
if x < 0.19Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6497.9
Simplified97.9%
Taylor expanded in x around inf
lower-+.f64N/A
log-recN/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
Simplified97.9%
if 0.19 < x Initial program 85.4%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6499.6
Simplified99.6%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(if (<= x 0.205)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
(fma x (fma -0.5 (log x) 0.91893853320467) 0.083333333333333))
x)
(+
(* z (* z (/ (+ 0.0007936500793651 y) x)))
(+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 0.205) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), fma(x, fma(-0.5, log(x), 0.91893853320467), 0.083333333333333)) / x;
} else {
tmp = (z * (z * ((0.0007936500793651 + y) / x))) + (0.91893853320467 + ((log(x) * (x - 0.5)) - x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 0.205) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), fma(x, fma(-0.5, log(x), 0.91893853320467), 0.083333333333333)) / x); else tmp = Float64(Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x))) + Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 0.205], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + N[(x * N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.205:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \mathsf{fma}\left(x, \mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right), 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right) + \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right)\\
\end{array}
\end{array}
if x < 0.204999999999999988Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6497.9
Simplified97.9%
if 0.204999999999999988 < x Initial program 85.4%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6499.6
Simplified99.6%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(if (<= x 1.0)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
(fma x (fma -0.5 (log x) 0.91893853320467) 0.083333333333333))
x)
(+ (- (* x (log x)) x) (* z (* z (/ (+ 0.0007936500793651 y) x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), fma(x, fma(-0.5, log(x), 0.91893853320467), 0.083333333333333)) / x;
} else {
tmp = ((x * log(x)) - x) + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), fma(x, fma(-0.5, log(x), 0.91893853320467), 0.083333333333333)) / x); else tmp = Float64(Float64(Float64(x * log(x)) - x) + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + N[(x * N[(-0.5 * N[Log[x], $MachinePrecision] + 0.91893853320467), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), \mathsf{fma}\left(x, \mathsf{fma}\left(-0.5, \log x, 0.91893853320467\right), 0.083333333333333\right)\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log x - x\right) + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6497.9
Simplified97.9%
if 1 < x Initial program 85.4%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6499.6
Simplified99.6%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6499.2
Simplified99.2%
(FPCore (x y z)
:precision binary64
(if (<= x 1.0)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(+ (- (* x (log x)) x) (* z (* z (/ (+ 0.0007936500793651 y) x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.0) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = ((x * log(x)) - x) + (z * (z * ((0.0007936500793651 + y) / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.0) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(Float64(Float64(x * log(x)) - x) + Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.0], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \log x - x\right) + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 1Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6497.2
Simplified97.2%
if 1 < x Initial program 85.4%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6499.6
Simplified99.6%
Taylor expanded in x around inf
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
lower-log.f6499.2
Simplified99.2%
(FPCore (x y z)
:precision binary64
(if (<= x 6.8e+65)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(fma x (log x) (- x))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.8e+65) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = fma(x, log(x), -x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 6.8e+65) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = fma(x, log(x), Float64(-x)); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 6.8e+65], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.8 \cdot 10^{+65}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \log x, -x\right)\\
\end{array}
\end{array}
if x < 6.7999999999999999e65Initial program 98.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6493.1
Simplified93.1%
if 6.7999999999999999e65 < x Initial program 84.3%
Taylor expanded in y around inf
Simplified88.4%
Taylor expanded in x around inf
sub-negN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
neg-mul-1N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-neg.f6472.8
Simplified72.8%
(FPCore (x y z)
:precision binary64
(if (<= x 6.8e+65)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(- (* x (log x)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 6.8e+65) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = (x * log(x)) - x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 6.8e+65) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(Float64(x * log(x)) - x); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 6.8e+65], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.8 \cdot 10^{+65}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log x - x\\
\end{array}
\end{array}
if x < 6.7999999999999999e65Initial program 98.6%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6493.1
Simplified93.1%
if 6.7999999999999999e65 < x Initial program 84.3%
Taylor expanded in x around inf
sub-negN/A
mul-1-negN/A
log-recN/A
remove-double-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
neg-mul-1N/A
unsub-negN/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6472.8
Simplified72.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* z (/ (+ 0.0007936500793651 y) x))))
(t_1
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))))
(if (<= t_1 -2e+75)
t_0
(if (<= t_1 5e+27)
(/
(fma
z
(fma z 0.0007936500793651 -0.0027777777777778)
0.083333333333333)
x)
t_0))))
double code(double x, double y, double z) {
double t_0 = z * (z * ((0.0007936500793651 + y) / x));
double t_1 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_1 <= -2e+75) {
tmp = t_0;
} else if (t_1 <= 5e+27) {
tmp = fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x))) t_1 = Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) tmp = 0.0 if (t_1 <= -2e+75) tmp = t_0; elseif (t_1 <= 5e+27) tmp = Float64(fma(z, fma(z, 0.0007936500793651, -0.0027777777777778), 0.083333333333333) / x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+75], t$95$0, If[LessEqual[t$95$1, 5e+27], N[(N[(z * N[(z * 0.0007936500793651 + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
t_1 := 0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+27}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -1.99999999999999985e75 or 4.99999999999999979e27 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 88.2%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6497.7
Simplified97.7%
Taylor expanded in x around 0
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
lower-+.f6481.5
Simplified81.5%
if -1.99999999999999985e75 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 4.99999999999999979e27Initial program 99.5%
Taylor expanded in y around inf
Simplified93.3%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified57.6%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6457.6
Simplified57.6%
Final simplification70.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))))
(if (<= t_0 -2e+75)
(* z (* y (/ z x)))
(if (<= t_0 0.1)
(/ (fma z -0.0027777777777778 0.083333333333333) x)
(* z (/ (* z 0.0007936500793651) x))))))
double code(double x, double y, double z) {
double t_0 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_0 <= -2e+75) {
tmp = z * (y * (z / x));
} else if (t_0 <= 0.1) {
tmp = fma(z, -0.0027777777777778, 0.083333333333333) / x;
} else {
tmp = z * ((z * 0.0007936500793651) / x);
}
return tmp;
}
function code(x, y, z) t_0 = Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) tmp = 0.0 if (t_0 <= -2e+75) tmp = Float64(z * Float64(y * Float64(z / x))); elseif (t_0 <= 0.1) tmp = Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x); else tmp = Float64(z * Float64(Float64(z * 0.0007936500793651) / x)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+75], N[(z * N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.1], N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(N[(z * 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+75}:\\
\;\;\;\;z \cdot \left(y \cdot \frac{z}{x}\right)\\
\mathbf{elif}\;t\_0 \leq 0.1:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{z \cdot 0.0007936500793651}{x}\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -1.99999999999999985e75Initial program 91.1%
Taylor expanded in y around inf
Simplified99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Simplified86.2%
Taylor expanded in y around inf
lower-/.f6486.2
Simplified86.2%
if -1.99999999999999985e75 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 0.10000000000000001Initial program 99.5%
Taylor expanded in y around inf
Simplified93.9%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified56.5%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6456.5
Simplified56.5%
if 0.10000000000000001 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 87.3%
Taylor expanded in y around inf
Simplified76.4%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Simplified62.1%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6459.7
Simplified59.7%
Final simplification62.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* y (/ z x))))
(t_1
(+
0.083333333333333
(* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))))
(if (<= t_1 -2e+75)
t_0
(if (<= t_1 5e+27)
(/ (fma z -0.0027777777777778 0.083333333333333) x)
t_0))))
double code(double x, double y, double z) {
double t_0 = z * (y * (z / x));
double t_1 = 0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778));
double tmp;
if (t_1 <= -2e+75) {
tmp = t_0;
} else if (t_1 <= 5e+27) {
tmp = fma(z, -0.0027777777777778, 0.083333333333333) / x;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * Float64(y * Float64(z / x))) t_1 = Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) tmp = 0.0 if (t_1 <= -2e+75) tmp = t_0; elseif (t_1 <= 5e+27) tmp = Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+75], t$95$0, If[LessEqual[t$95$1, 5e+27], N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(y \cdot \frac{z}{x}\right)\\
t_1 := 0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+27}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < -1.99999999999999985e75 or 4.99999999999999979e27 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) Initial program 88.2%
Taylor expanded in y around inf
Simplified84.0%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Simplified70.5%
Taylor expanded in y around inf
lower-/.f6456.8
Simplified56.8%
if -1.99999999999999985e75 < (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) < 4.99999999999999979e27Initial program 99.5%
Taylor expanded in y around inf
Simplified93.3%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified57.6%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6455.4
Simplified55.4%
Final simplification56.2%
(FPCore (x y z)
:precision binary64
(if (<= x 1.35e+44)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(*
z
(fma
z
(* (/ 1.0 (* x z)) (- (/ 0.083333333333333 z) 0.0027777777777778))
(* (+ 0.0007936500793651 y) (/ z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.35e+44) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = z * fma(z, ((1.0 / (x * z)) * ((0.083333333333333 / z) - 0.0027777777777778)), ((0.0007936500793651 + y) * (z / x)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 1.35e+44) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(z * fma(z, Float64(Float64(1.0 / Float64(x * z)) * Float64(Float64(0.083333333333333 / z) - 0.0027777777777778)), Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 1.35e+44], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(z * N[(N[(1.0 / N[(x * z), $MachinePrecision]), $MachinePrecision] * N[(N[(0.083333333333333 / z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.35 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(z, \frac{1}{x \cdot z} \cdot \left(\frac{0.083333333333333}{z} - 0.0027777777777778\right), \left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if x < 1.35e44Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6494.6
Simplified94.6%
if 1.35e44 < x Initial program 83.4%
Taylor expanded in y around inf
Simplified88.2%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified25.2%
Taylor expanded in z around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
Simplified26.5%
Taylor expanded in z around -inf
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
distribute-lft-inN/A
lower-fma.f64N/A
Simplified32.5%
Final simplification71.3%
(FPCore (x y z)
:precision binary64
(if (<= x 5e+44)
(/
(fma
z
(fma z (+ 0.0007936500793651 y) -0.0027777777777778)
0.083333333333333)
x)
(* z (* z (/ (+ 0.0007936500793651 y) x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+44) {
tmp = fma(z, fma(z, (0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x;
} else {
tmp = z * (z * ((0.0007936500793651 + y) / x));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5e+44) tmp = Float64(fma(z, fma(z, Float64(0.0007936500793651 + y), -0.0027777777777778), 0.083333333333333) / x); else tmp = Float64(z * Float64(z * Float64(Float64(0.0007936500793651 + y) / x))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5e+44], N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(z * N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\
\end{array}
\end{array}
if x < 4.9999999999999996e44Initial program 99.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-+.f6494.6
Simplified94.6%
if 4.9999999999999996e44 < x Initial program 83.4%
Taylor expanded in z around inf
associate-/l*N/A
unpow2N/A
associate-*l*N/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f6499.5
Simplified99.5%
Taylor expanded in x around 0
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
lower-+.f6432.1
Simplified32.1%
(FPCore (x y z) :precision binary64 (/ (fma z -0.0027777777777778 0.083333333333333) x))
double code(double x, double y, double z) {
return fma(z, -0.0027777777777778, 0.083333333333333) / x;
}
function code(x, y, z) return Float64(fma(z, -0.0027777777777778, 0.083333333333333) / x) end
code[x_, y_, z_] := N[(N[(z * -0.0027777777777778 + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\mathsf{fma}\left(z, -0.0027777777777778, 0.083333333333333\right)}{x}
\end{array}
Initial program 93.6%
Taylor expanded in y around inf
Simplified90.6%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified67.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6431.9
Simplified31.9%
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
return 0.083333333333333 / x;
}
def code(x, y, z): return 0.083333333333333 / x
function code(x, y, z) return Float64(0.083333333333333 / x) end
function tmp = code(x, y, z) tmp = 0.083333333333333 / x; end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.083333333333333}{x}
\end{array}
Initial program 93.6%
Taylor expanded in y around inf
Simplified90.6%
Taylor expanded in x around 0
lower-/.f64N/A
Simplified67.8%
Taylor expanded in z around 0
lower-/.f6427.8
Simplified27.8%
(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 2024208
(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)))