| Alternative 1 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 15945 |
(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (+ -0.0027777777777778 (* (+ y 0.0007936500793651) z)))))
(if (or (<= t_0 -2e+102) (not (<= t_0 5e+162)))
(+
(+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
(+
(fma -0.0027777777777778 (/ z x) (/ 0.083333333333333 x))
(* z (* z (+ (/ y x) (/ 0.0007936500793651 x))))))
(+
0.91893853320467
(-
(/
(fma
z
(fma (+ y 0.0007936500793651) z -0.0027777777777778)
0.083333333333333)
x)
(fma (log x) (- 0.5 x) (expm1 (log1p 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);
}
double code(double x, double y, double z) {
double t_0 = z * (-0.0027777777777778 + ((y + 0.0007936500793651) * z));
double tmp;
if ((t_0 <= -2e+102) || !(t_0 <= 5e+162)) {
tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + (fma(-0.0027777777777778, (z / x), (0.083333333333333 / x)) + (z * (z * ((y / x) + (0.0007936500793651 / x)))));
} else {
tmp = 0.91893853320467 + ((fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) - fma(log(x), (0.5 - x), expm1(log1p(x))));
}
return tmp;
}
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 code(x, y, z) t_0 = Float64(z * Float64(-0.0027777777777778 + Float64(Float64(y + 0.0007936500793651) * z))) tmp = 0.0 if ((t_0 <= -2e+102) || !(t_0 <= 5e+162)) tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + Float64(fma(-0.0027777777777778, Float64(z / x), Float64(0.083333333333333 / x)) + Float64(z * Float64(z * Float64(Float64(y / x) + Float64(0.0007936500793651 / x)))))); else tmp = Float64(0.91893853320467 + Float64(Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x) - fma(log(x), Float64(0.5 - x), expm1(log1p(x))))); end return tmp 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]
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-0.0027777777777778 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e+102], N[Not[LessEqual[t$95$0, 5e+162]], $MachinePrecision]], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(-0.0027777777777778 * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z * N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.91893853320467 + N[(N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision] - N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision] + N[(Exp[N[Log[1 + x], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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}
\begin{array}{l}
t_0 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+102} \lor \neg \left(t_0 \leq 5 \cdot 10^{+162}\right):\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \mathsf{fma}\left(\log x, 0.5 - x, \mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)\right)\right)\\
\end{array}
| Original | 90.5% |
|---|---|
| Target | 97.8% |
| Herbie | 99.2% |
if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -1.99999999999999995e102 or 4.9999999999999997e162 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) Initial program 56.9%
Applied egg-rr56.5%
[Start]56.9 | \[ \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}
\] |
|---|---|
add-cube-cbrt [=>]56.5 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(\sqrt[3]{\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}} \cdot \sqrt[3]{\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}}\right) \cdot \sqrt[3]{\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}}}
\] |
pow3 [=>]56.5 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{{\left(\sqrt[3]{\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}}\right)}^{3}}
\] |
*-commutative [=>]56.5 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(\sqrt[3]{\frac{\color{blue}{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)} + 0.083333333333333}{x}}\right)}^{3}
\] |
fma-def [=>]56.5 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(\sqrt[3]{\frac{\color{blue}{\mathsf{fma}\left(z, \left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, 0.083333333333333\right)}}{x}}\right)}^{3}
\] |
fma-neg [=>]56.5 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(\sqrt[3]{\frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right)}, 0.083333333333333\right)}{x}}\right)}^{3}
\] |
metadata-eval [=>]56.5 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(\sqrt[3]{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, \color{blue}{-0.0027777777777778}\right), 0.083333333333333\right)}{x}}\right)}^{3}
\] |
Applied egg-rr56.9%
[Start]56.5 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(\sqrt[3]{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}}\right)}^{3}
\] |
|---|---|
rem-cube-cbrt [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}}
\] |
frac-2neg [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{-x}}
\] |
clear-num [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{1}{\frac{-x}{-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}}}
\] |
associate-/r/ [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{1}{-x} \cdot \left(-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)}
\] |
*-un-lft-identity [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{-\color{blue}{1 \cdot x}} \cdot \left(-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)
\] |
distribute-lft-neg-in [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{\color{blue}{\left(-1\right) \cdot x}} \cdot \left(-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)
\] |
associate-/r* [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{\frac{1}{-1}}{x}} \cdot \left(-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)
\] |
metadata-eval [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\frac{1}{\color{blue}{-1}}}{x} \cdot \left(-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)
\] |
metadata-eval [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{-1}}{x} \cdot \left(-\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)
\] |
neg-sub0 [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{-1}{x} \cdot \color{blue}{\left(0 - \mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)}
\] |
metadata-eval [<=]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{-1}{x} \cdot \left(\color{blue}{\log 1} - \mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)\right)
\] |
fma-udef [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{-1}{x} \cdot \left(\log 1 - \color{blue}{\left(z \cdot \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right) + 0.083333333333333\right)}\right)
\] |
+-commutative [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{-1}{x} \cdot \left(\log 1 - \color{blue}{\left(0.083333333333333 + z \cdot \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right)\right)}\right)
\] |
associate--r+ [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{-1}{x} \cdot \color{blue}{\left(\left(\log 1 - 0.083333333333333\right) - z \cdot \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right)\right)}
\] |
metadata-eval [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{-1}{x} \cdot \left(\left(\color{blue}{0} - 0.083333333333333\right) - z \cdot \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right)\right)
\] |
metadata-eval [=>]56.9 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{-1}{x} \cdot \left(\color{blue}{-0.083333333333333} - z \cdot \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right)\right)
\] |
Taylor expanded in z around 0 70.4%
Simplified97.2%
[Start]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(0.083333333333333 \cdot \frac{1}{x} + \left(-0.0027777777777778 \cdot \frac{z}{x} + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)\right)
\] |
|---|---|
associate-+r+ [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(\left(0.083333333333333 \cdot \frac{1}{x} + -0.0027777777777778 \cdot \frac{z}{x}\right) + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)}
\] |
+-commutative [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{\left(-0.0027777777777778 \cdot \frac{z}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)} + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
associate-*r/ [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(-0.0027777777777778 \cdot \frac{z}{x} + \color{blue}{\frac{0.083333333333333 \cdot 1}{x}}\right) + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
metadata-eval [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(-0.0027777777777778 \cdot \frac{z}{x} + \frac{\color{blue}{0.083333333333333}}{x}\right) + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
metadata-eval [<=]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(-0.0027777777777778 \cdot \frac{z}{x} + \frac{\color{blue}{-1 \cdot -0.083333333333333}}{x}\right) + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
associate-*l/ [<=]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\left(-0.0027777777777778 \cdot \frac{z}{x} + \color{blue}{\frac{-1}{x} \cdot -0.083333333333333}\right) + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
fma-def [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{-1}{x} \cdot -0.083333333333333\right)} + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
associate-*l/ [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \color{blue}{\frac{-1 \cdot -0.083333333333333}{x}}\right) + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
metadata-eval [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{\color{blue}{0.083333333333333}}{x}\right) + \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right) \cdot {z}^{2}\right)
\] |
*-commutative [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \color{blue}{{z}^{2} \cdot \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right)}\right)
\] |
unpow2 [=>]70.4 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \color{blue}{\left(z \cdot z\right)} \cdot \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right)\right)
\] |
associate-*l* [=>]97.2 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \color{blue}{z \cdot \left(z \cdot \left(\frac{y}{x} + 0.0007936500793651 \cdot \frac{1}{x}\right)\right)}\right)
\] |
associate-*r/ [=>]97.2 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + z \cdot \left(z \cdot \left(\frac{y}{x} + \color{blue}{\frac{0.0007936500793651 \cdot 1}{x}}\right)\right)\right)
\] |
metadata-eval [=>]97.2 | \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{\color{blue}{0.0007936500793651}}{x}\right)\right)\right)
\] |
if -1.99999999999999995e102 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 4.9999999999999997e162Initial program 99.4%
Simplified99.5%
[Start]99.4 | \[ \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}
\] |
|---|---|
+-commutative [=>]99.4 | \[ \color{blue}{\left(0.91893853320467 + \left(\left(x - 0.5\right) \cdot \log x - x\right)\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\] |
associate-+l+ [=>]99.4 | \[ \color{blue}{0.91893853320467 + \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\right)}
\] |
+-commutative [<=]99.4 | \[ 0.91893853320467 + \color{blue}{\left(\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} + \left(\left(x - 0.5\right) \cdot \log x - x\right)\right)}
\] |
sub-neg [=>]99.4 | \[ 0.91893853320467 + \left(\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} + \color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)}\right)
\] |
+-commutative [=>]99.4 | \[ 0.91893853320467 + \left(\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} + \color{blue}{\left(\left(-x\right) + \left(x - 0.5\right) \cdot \log x\right)}\right)
\] |
associate-+r+ [=>]99.4 | \[ 0.91893853320467 + \color{blue}{\left(\left(\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} + \left(-x\right)\right) + \left(x - 0.5\right) \cdot \log x\right)}
\] |
unsub-neg [=>]99.4 | \[ 0.91893853320467 + \left(\color{blue}{\left(\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} - x\right)} + \left(x - 0.5\right) \cdot \log x\right)
\] |
associate-+l- [=>]99.4 | \[ 0.91893853320467 + \color{blue}{\left(\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} - \left(x - \left(x - 0.5\right) \cdot \log x\right)\right)}
\] |
remove-double-neg [<=]99.4 | \[ 0.91893853320467 + \left(\color{blue}{\left(-\left(-\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\right)\right)} - \left(x - \left(x - 0.5\right) \cdot \log x\right)\right)
\] |
neg-mul-1 [=>]99.4 | \[ 0.91893853320467 + \left(\color{blue}{-1 \cdot \left(-\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\right)} - \left(x - \left(x - 0.5\right) \cdot \log x\right)\right)
\] |
*-commutative [<=]99.4 | \[ 0.91893853320467 + \left(\color{blue}{\left(-\frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\right) \cdot -1} - \left(x - \left(x - 0.5\right) \cdot \log x\right)\right)
\] |
Applied egg-rr99.5%
[Start]99.5 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right)
\] |
|---|---|
fma-udef [=>]99.4 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \color{blue}{\left(\log x \cdot \left(0.5 - x\right) + x\right)}\right)
\] |
+-commutative [=>]99.4 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \color{blue}{\left(x + \log x \cdot \left(0.5 - x\right)\right)}\right)
\] |
expm1-log1p-u [=>]99.5 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)} + \log x \cdot \left(0.5 - x\right)\right)\right)
\] |
expm1-udef [=>]99.5 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \left(\color{blue}{\left(e^{\mathsf{log1p}\left(x\right)} - 1\right)} + \log x \cdot \left(0.5 - x\right)\right)\right)
\] |
associate-+l- [=>]99.5 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \color{blue}{\left(e^{\mathsf{log1p}\left(x\right)} - \left(1 - \log x \cdot \left(0.5 - x\right)\right)\right)}\right)
\] |
Simplified99.7%
[Start]99.5 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \left(e^{\mathsf{log1p}\left(x\right)} - \left(1 - \log x \cdot \left(0.5 - x\right)\right)\right)\right)
\] |
|---|---|
associate--r- [=>]99.5 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \color{blue}{\left(\left(e^{\mathsf{log1p}\left(x\right)} - 1\right) + \log x \cdot \left(0.5 - x\right)\right)}\right)
\] |
+-commutative [<=]99.5 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \color{blue}{\left(\log x \cdot \left(0.5 - x\right) + \left(e^{\mathsf{log1p}\left(x\right)} - 1\right)\right)}\right)
\] |
fma-def [=>]99.7 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \color{blue}{\mathsf{fma}\left(\log x, 0.5 - x, e^{\mathsf{log1p}\left(x\right)} - 1\right)}\right)
\] |
expm1-def [=>]99.7 | \[ 0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \mathsf{fma}\left(\log x, 0.5 - x, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)}\right)\right)
\] |
Final simplification99.2%
| Alternative 1 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 15945 |
| Alternative 2 | |
|---|---|
| Accuracy | 98.7% |
| Cost | 15560 |
| Alternative 3 | |
|---|---|
| Accuracy | 98.7% |
| Cost | 9160 |
| Alternative 4 | |
|---|---|
| Accuracy | 80.0% |
| Cost | 7757 |
| Alternative 5 | |
|---|---|
| Accuracy | 90.0% |
| Cost | 7752 |
| Alternative 6 | |
|---|---|
| Accuracy | 91.4% |
| Cost | 7752 |
| Alternative 7 | |
|---|---|
| Accuracy | 91.5% |
| Cost | 7752 |
| Alternative 8 | |
|---|---|
| Accuracy | 91.5% |
| Cost | 7752 |
| Alternative 9 | |
|---|---|
| Accuracy | 95.5% |
| Cost | 7752 |
| Alternative 10 | |
|---|---|
| Accuracy | 97.0% |
| Cost | 7748 |
| Alternative 11 | |
|---|---|
| Accuracy | 84.2% |
| Cost | 7624 |
| Alternative 12 | |
|---|---|
| Accuracy | 88.0% |
| Cost | 7624 |
| Alternative 13 | |
|---|---|
| Accuracy | 81.5% |
| Cost | 7232 |
| Alternative 14 | |
|---|---|
| Accuracy | 79.8% |
| Cost | 7104 |
| Alternative 15 | |
|---|---|
| Accuracy | 31.8% |
| Cost | 6656 |
| Alternative 16 | |
|---|---|
| Accuracy | 31.8% |
| Cost | 192 |
herbie shell --seed 2023133
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))