| Alternative 1 | |
|---|---|
| Accuracy | 98.0% |
| Cost | 7624 |
(FPCore (x y z)
:precision binary64
(/
(*
(- x 2.0)
(+
(*
(+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y)
x)
z))
(+
(* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x)
47.066876606)))(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
(- (+ (pow x 2.0) 4.0) (* x -2.0))
(+
47.066876606
(*
x
(+
313.399215894
(* x (+ 263.505074721 (* x (+ x 43.3400022514)))))))))
(t_1 (- (pow x 3.0) 8.0)))
(if (<= x -2.95e+38)
(+
(* x 4.16438922228)
(+ (/ 3655.1204654076414 x) (/ (- y 130977.50649958357) (* x x))))
(if (<= x 8.6e+22)
(+
(/
(*
t_1
(+
(*
(pow x 2.0)
(+ 137.519416416 (* x (+ (* x 4.16438922228) 78.6994924154))))
z))
t_0)
(/ (* t_1 (* x y)) t_0))
(+
(/ 4752.4581585918595 x)
(-
(fma 4.16438922228 x (/ (- y 207551.7024428275) (* x x)))
110.1139242984811))))))double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
double code(double x, double y, double z) {
double t_0 = ((pow(x, 2.0) + 4.0) - (x * -2.0)) * (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))));
double t_1 = pow(x, 3.0) - 8.0;
double tmp;
if (x <= -2.95e+38) {
tmp = (x * 4.16438922228) + ((3655.1204654076414 / x) + ((y - 130977.50649958357) / (x * x)));
} else if (x <= 8.6e+22) {
tmp = ((t_1 * ((pow(x, 2.0) * (137.519416416 + (x * ((x * 4.16438922228) + 78.6994924154)))) + z)) / t_0) + ((t_1 * (x * y)) / t_0);
} else {
tmp = (4752.4581585918595 / x) + (fma(4.16438922228, x, ((y - 207551.7024428275) / (x * x))) - 110.1139242984811);
}
return tmp;
}
function code(x, y, z) return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) end
function code(x, y, z) t_0 = Float64(Float64(Float64((x ^ 2.0) + 4.0) - Float64(x * -2.0)) * Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))) t_1 = Float64((x ^ 3.0) - 8.0) tmp = 0.0 if (x <= -2.95e+38) tmp = Float64(Float64(x * 4.16438922228) + Float64(Float64(3655.1204654076414 / x) + Float64(Float64(y - 130977.50649958357) / Float64(x * x)))); elseif (x <= 8.6e+22) tmp = Float64(Float64(Float64(t_1 * Float64(Float64((x ^ 2.0) * Float64(137.519416416 + Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)))) + z)) / t_0) + Float64(Float64(t_1 * Float64(x * y)) / t_0)); else tmp = Float64(Float64(4752.4581585918595 / x) + Float64(fma(4.16438922228, x, Float64(Float64(y - 207551.7024428275) / Float64(x * x))) - 110.1139242984811)); end return tmp end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[Power[x, 2.0], $MachinePrecision] + 4.0), $MachinePrecision] - N[(x * -2.0), $MachinePrecision]), $MachinePrecision] * N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 3.0], $MachinePrecision] - 8.0), $MachinePrecision]}, If[LessEqual[x, -2.95e+38], N[(N[(x * 4.16438922228), $MachinePrecision] + N[(N[(3655.1204654076414 / x), $MachinePrecision] + N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.6e+22], N[(N[(N[(t$95$1 * N[(N[(N[Power[x, 2.0], $MachinePrecision] * N[(137.519416416 + N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(t$95$1 * N[(x * y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(4752.4581585918595 / x), $MachinePrecision] + N[(N[(4.16438922228 * x + N[(N[(y - 207551.7024428275), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision]), $MachinePrecision]]]]]
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\begin{array}{l}
t_0 := \left(\left({x}^{2} + 4\right) - x \cdot -2\right) \cdot \left(47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\right)\\
t_1 := {x}^{3} - 8\\
\mathbf{if}\;x \leq -2.95 \cdot 10^{+38}:\\
\;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} + \frac{y - 130977.50649958357}{x \cdot x}\right)\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{t_1 \cdot \left({x}^{2} \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)\right) + z\right)}{t_0} + \frac{t_1 \cdot \left(x \cdot y\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{4752.4581585918595}{x} + \left(\mathsf{fma}\left(4.16438922228, x, \frac{y - 207551.7024428275}{x \cdot x}\right) - 110.1139242984811\right)\\
\end{array}
| Original | 57.8% |
|---|---|
| Target | 98.8% |
| Herbie | 97.4% |
if x < -2.94999999999999991e38Initial program 6.6%
Simplified12.2%
[Start]6.6 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
|---|---|
*-commutative [=>]6.6 | \[ \frac{\color{blue}{\left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right) \cdot \left(x - 2\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
associate-*r/ [<=]12.2 | \[ \color{blue}{\left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right) \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}}
\] |
*-commutative [=>]12.2 | \[ \left(\color{blue}{x \cdot \left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right)} + z\right) \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]12.2 | \[ \color{blue}{\mathsf{fma}\left(x, \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, z\right)} \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]12.2 | \[ \mathsf{fma}\left(x, \color{blue}{x \cdot \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right)} + y, z\right) \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]12.2 | \[ \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, \left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, y\right)}, z\right) \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]12.2 | \[ \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)} + 137.519416416, y\right), z\right) \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]12.2 | \[ \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, x \cdot 4.16438922228 + 78.6994924154, 137.519416416\right)}, y\right), z\right) \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]12.2 | \[ \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, 137.519416416\right), y\right), z\right) \cdot \frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
Taylor expanded in x around inf 97.4%
Simplified97.4%
[Start]97.4 | \[ \left(\frac{y}{{x}^{2}} + \left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right)\right) - \left(110.1139242984811 + 130977.50649958357 \cdot \frac{1}{{x}^{2}}\right)
\] |
|---|---|
associate--l+ [=>]97.4 | \[ \color{blue}{\frac{y}{{x}^{2}} + \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - \left(110.1139242984811 + 130977.50649958357 \cdot \frac{1}{{x}^{2}}\right)\right)}
\] |
+-commutative [=>]97.4 | \[ \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - \left(110.1139242984811 + 130977.50649958357 \cdot \frac{1}{{x}^{2}}\right)\right) + \frac{y}{{x}^{2}}}
\] |
associate--r+ [=>]97.4 | \[ \color{blue}{\left(\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\right) - 130977.50649958357 \cdot \frac{1}{{x}^{2}}\right)} + \frac{y}{{x}^{2}}
\] |
associate-+l- [=>]97.4 | \[ \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\right) - \left(130977.50649958357 \cdot \frac{1}{{x}^{2}} - \frac{y}{{x}^{2}}\right)}
\] |
associate-*r/ [=>]97.4 | \[ \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\right) - \left(\color{blue}{\frac{130977.50649958357 \cdot 1}{{x}^{2}}} - \frac{y}{{x}^{2}}\right)
\] |
metadata-eval [=>]97.4 | \[ \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\right) - \left(\frac{\color{blue}{130977.50649958357}}{{x}^{2}} - \frac{y}{{x}^{2}}\right)
\] |
div-sub [<=]97.4 | \[ \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\right) - \color{blue}{\frac{130977.50649958357 - y}{{x}^{2}}}
\] |
unsub-neg [<=]97.4 | \[ \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\right) - \frac{\color{blue}{130977.50649958357 + \left(-y\right)}}{{x}^{2}}
\] |
mul-1-neg [<=]97.4 | \[ \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\right) - \frac{130977.50649958357 + \color{blue}{-1 \cdot y}}{{x}^{2}}
\] |
sub-neg [=>]97.4 | \[ \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) + \left(-110.1139242984811\right)\right)} - \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}
\] |
+-commutative [=>]97.4 | \[ \color{blue}{\left(\left(-110.1139242984811\right) + \left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right)\right)} - \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}
\] |
associate-+r- [<=]97.4 | \[ \color{blue}{\left(-110.1139242984811\right) + \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)}
\] |
unsub-neg [<=]97.4 | \[ \left(-110.1139242984811\right) + \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) + \left(-\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)\right)}
\] |
Taylor expanded in x around inf 97.4%
Simplified97.4%
[Start]97.4 | \[ 4.16438922228 \cdot x + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)
\] |
|---|---|
*-commutative [<=]97.4 | \[ \color{blue}{x \cdot 4.16438922228} + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)
\] |
if -2.94999999999999991e38 < x < 8.6000000000000004e22Initial program 98.9%
Simplified99.4%
[Start]98.9 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
|---|---|
associate-*r/ [<=]99.4 | \[ \color{blue}{\left(x - 2\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}}
\] |
sub-neg [=>]99.4 | \[ \color{blue}{\left(x + \left(-2\right)\right)} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
metadata-eval [=>]99.4 | \[ \left(x + \color{blue}{-2}\right) \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\color{blue}{x \cdot \left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right)} + z}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(x, \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, z\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \color{blue}{x \cdot \left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right)} + y, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, \left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, y\right)}, z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)} + 137.519416416, y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, x \cdot 4.16438922228 + 78.6994924154, 137.519416416\right)}, y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
fma-def [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, 137.519416416\right), y\right), z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
*-commutative [=>]99.4 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\color{blue}{x \cdot \left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right)} + 47.066876606}
\] |
Applied egg-rr99.4%
[Start]99.4 | \[ \left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)}
\] |
|---|---|
*-commutative [=>]99.4 | \[ \color{blue}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left(x + -2\right)}
\] |
flip3-+ [=>]99.4 | \[ \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \color{blue}{\frac{{x}^{3} + {-2}^{3}}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}}
\] |
associate-*r/ [=>]99.4 | \[ \color{blue}{\frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left({x}^{3} + {-2}^{3}\right)}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}}
\] |
metadata-eval [=>]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left({x}^{3} + \color{blue}{-8}\right)}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}
\] |
metadata-eval [<=]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left({x}^{3} + \color{blue}{4 \cdot -2}\right)}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}
\] |
metadata-eval [<=]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left({x}^{3} + \color{blue}{\left(-2 \cdot -2\right)} \cdot -2\right)}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}
\] |
+-commutative [=>]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \color{blue}{\left(\left(-2 \cdot -2\right) \cdot -2 + {x}^{3}\right)}}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}
\] |
metadata-eval [=>]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left(\color{blue}{4} \cdot -2 + {x}^{3}\right)}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}
\] |
metadata-eval [=>]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left(\color{blue}{-8} + {x}^{3}\right)}{x \cdot x + \left(-2 \cdot -2 - x \cdot -2\right)}
\] |
fma-def [=>]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left(-8 + {x}^{3}\right)}{\color{blue}{\mathsf{fma}\left(x, x, -2 \cdot -2 - x \cdot -2\right)}}
\] |
metadata-eval [=>]99.4 | \[ \frac{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)} \cdot \left(-8 + {x}^{3}\right)}{\mathsf{fma}\left(x, x, \color{blue}{4} - x \cdot -2\right)}
\] |
Taylor expanded in y around inf 97.9%
if 8.6000000000000004e22 < x Initial program 10.1%
Taylor expanded in x around inf 10.1%
Simplified10.1%
[Start]10.1 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(43.3400022514 \cdot {x}^{2} + {x}^{3}\right) + 313.399215894\right) \cdot x + 47.066876606}
\] |
|---|---|
+-commutative [=>]10.1 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\color{blue}{\left({x}^{3} + 43.3400022514 \cdot {x}^{2}\right)} + 313.399215894\right) \cdot x + 47.066876606}
\] |
cube-mult [=>]10.1 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\color{blue}{x \cdot \left(x \cdot x\right)} + 43.3400022514 \cdot {x}^{2}\right) + 313.399215894\right) \cdot x + 47.066876606}
\] |
unpow2 [<=]10.1 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(x \cdot \color{blue}{{x}^{2}} + 43.3400022514 \cdot {x}^{2}\right) + 313.399215894\right) \cdot x + 47.066876606}
\] |
distribute-rgt-out [=>]10.1 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\color{blue}{{x}^{2} \cdot \left(x + 43.3400022514\right)} + 313.399215894\right) \cdot x + 47.066876606}
\] |
unpow2 [=>]10.1 | \[ \frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\color{blue}{\left(x \cdot x\right)} \cdot \left(x + 43.3400022514\right) + 313.399215894\right) \cdot x + 47.066876606}
\] |
Taylor expanded in x around -inf 96.5%
Simplified96.5%
[Start]96.5 | \[ \left(4752.4581585918595 \cdot \frac{1}{x} + \left(4.16438922228 \cdot x + -1 \cdot \frac{207551.7024428275 + -1 \cdot y}{{x}^{2}}\right)\right) - 110.1139242984811
\] |
|---|---|
associate--l+ [=>]96.5 | \[ \color{blue}{4752.4581585918595 \cdot \frac{1}{x} + \left(\left(4.16438922228 \cdot x + -1 \cdot \frac{207551.7024428275 + -1 \cdot y}{{x}^{2}}\right) - 110.1139242984811\right)}
\] |
associate-*r/ [=>]96.5 | \[ \color{blue}{\frac{4752.4581585918595 \cdot 1}{x}} + \left(\left(4.16438922228 \cdot x + -1 \cdot \frac{207551.7024428275 + -1 \cdot y}{{x}^{2}}\right) - 110.1139242984811\right)
\] |
metadata-eval [=>]96.5 | \[ \frac{\color{blue}{4752.4581585918595}}{x} + \left(\left(4.16438922228 \cdot x + -1 \cdot \frac{207551.7024428275 + -1 \cdot y}{{x}^{2}}\right) - 110.1139242984811\right)
\] |
fma-def [=>]96.5 | \[ \frac{4752.4581585918595}{x} + \left(\color{blue}{\mathsf{fma}\left(4.16438922228, x, -1 \cdot \frac{207551.7024428275 + -1 \cdot y}{{x}^{2}}\right)} - 110.1139242984811\right)
\] |
mul-1-neg [=>]96.5 | \[ \frac{4752.4581585918595}{x} + \left(\mathsf{fma}\left(4.16438922228, x, \color{blue}{-\frac{207551.7024428275 + -1 \cdot y}{{x}^{2}}}\right) - 110.1139242984811\right)
\] |
mul-1-neg [=>]96.5 | \[ \frac{4752.4581585918595}{x} + \left(\mathsf{fma}\left(4.16438922228, x, -\frac{207551.7024428275 + \color{blue}{\left(-y\right)}}{{x}^{2}}\right) - 110.1139242984811\right)
\] |
unpow2 [=>]96.5 | \[ \frac{4752.4581585918595}{x} + \left(\mathsf{fma}\left(4.16438922228, x, -\frac{207551.7024428275 + \left(-y\right)}{\color{blue}{x \cdot x}}\right) - 110.1139242984811\right)
\] |
Final simplification97.4%
| Alternative 1 | |
|---|---|
| Accuracy | 98.0% |
| Cost | 7624 |
| Alternative 2 | |
|---|---|
| Accuracy | 98.1% |
| Cost | 2633 |
| Alternative 3 | |
|---|---|
| Accuracy | 96.7% |
| Cost | 2505 |
| Alternative 4 | |
|---|---|
| Accuracy | 96.6% |
| Cost | 2376 |
| Alternative 5 | |
|---|---|
| Accuracy | 96.5% |
| Cost | 2120 |
| Alternative 6 | |
|---|---|
| Accuracy | 95.5% |
| Cost | 1992 |
| Alternative 7 | |
|---|---|
| Accuracy | 92.5% |
| Cost | 1353 |
| Alternative 8 | |
|---|---|
| Accuracy | 91.0% |
| Cost | 1352 |
| Alternative 9 | |
|---|---|
| Accuracy | 76.9% |
| Cost | 1097 |
| Alternative 10 | |
|---|---|
| Accuracy | 89.5% |
| Cost | 1097 |
| Alternative 11 | |
|---|---|
| Accuracy | 91.0% |
| Cost | 1096 |
| Alternative 12 | |
|---|---|
| Accuracy | 76.9% |
| Cost | 969 |
| Alternative 13 | |
|---|---|
| Accuracy | 76.7% |
| Cost | 841 |
| Alternative 14 | |
|---|---|
| Accuracy | 76.8% |
| Cost | 841 |
| Alternative 15 | |
|---|---|
| Accuracy | 76.7% |
| Cost | 713 |
| Alternative 16 | |
|---|---|
| Accuracy | 76.4% |
| Cost | 585 |
| Alternative 17 | |
|---|---|
| Accuracy | 76.5% |
| Cost | 585 |
| Alternative 18 | |
|---|---|
| Accuracy | 76.4% |
| Cost | 456 |
| Alternative 19 | |
|---|---|
| Accuracy | 45.5% |
| Cost | 192 |
herbie shell --seed 2023151
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< x -3.326128725870005e+62) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811) (if (< x 9.429991714554673e+55) (* (/ (- x 2.0) 1.0) (/ (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z) (+ (* (+ (+ (* 263.505074721 x) (+ (* 43.3400022514 (* x x)) (* x (* x x)))) 313.399215894) x) 47.066876606))) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811)))
(/ (* (- x 2.0) (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z)) (+ (* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x) 47.066876606)))