| Alternative 1 | |
|---|---|
| Error | 1.3 |
| Cost | 10632 |
(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
(if (<= x -1.05e+43)
(+
(fma x 4.16438922228 (/ 3655.1204654076414 x))
(+ -110.1139242984811 (/ (/ (- 130977.50649958357 y) x) (- x))))
(if (<= x 7.8e+15)
(*
(+ x -2.0)
(/
(fma
x
(fma x (fma x (fma x 4.16438922228 78.6994924154) 137.519416416) y)
z)
(fma
x
(fma x (fma x (+ x 43.3400022514) 263.505074721) 313.399215894)
47.066876606)))
(-
(* x 4.16438922228)
(+ (/ (- 130977.50649958357 y) (* 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 tmp;
if (x <= -1.05e+43) {
tmp = fma(x, 4.16438922228, (3655.1204654076414 / x)) + (-110.1139242984811 + (((130977.50649958357 - y) / x) / -x));
} else if (x <= 7.8e+15) {
tmp = (x + -2.0) * (fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) / fma(x, fma(x, fma(x, (x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606));
} else {
tmp = (x * 4.16438922228) - (((130977.50649958357 - y) / (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) tmp = 0.0 if (x <= -1.05e+43) tmp = Float64(fma(x, 4.16438922228, Float64(3655.1204654076414 / x)) + Float64(-110.1139242984811 + Float64(Float64(Float64(130977.50649958357 - y) / x) / Float64(-x)))); elseif (x <= 7.8e+15) tmp = Float64(Float64(x + -2.0) * Float64(fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) / fma(x, fma(x, fma(x, Float64(x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606))); else tmp = Float64(Float64(x * 4.16438922228) - Float64(Float64(Float64(130977.50649958357 - y) / 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_] := If[LessEqual[x, -1.05e+43], N[(N[(x * 4.16438922228 + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision] + N[(-110.1139242984811 + N[(N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.8e+15], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(x * N[(x * N[(x * N[(x * 4.16438922228 + 78.6994924154), $MachinePrecision] + 137.519416416), $MachinePrecision] + y), $MachinePrecision] + z), $MachinePrecision] / N[(x * N[(x * N[(x * N[(x + 43.3400022514), $MachinePrecision] + 263.505074721), $MachinePrecision] + 313.399215894), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 4.16438922228), $MachinePrecision] - N[(N[(N[(130977.50649958357 - y), $MachinePrecision] / N[(x * x), $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}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) + \left(-110.1139242984811 + \frac{\frac{130977.50649958357 - y}{x}}{-x}\right)\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+15}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 4.16438922228 - \left(\frac{130977.50649958357 - y}{x \cdot x} + 110.1139242984811\right)\\
\end{array}
| Original | 26.7 |
|---|---|
| Target | 0.9 |
| Herbie | 1.2 |
if x < -1.05000000000000001e43Initial program 60.7
Simplified56.9
[Start]60.7 | \[ \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-*l/ [<=]56.9 | \[ \color{blue}{\frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \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)}
\] |
*-commutative [=>]56.9 | \[ \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 [=>]56.9 | \[ \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 [=>]56.9 | \[ \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 [=>]56.9 | \[ \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 [=>]56.9 | \[ \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 [=>]56.9 | \[ \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 [=>]56.9 | \[ \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 [=>]56.9 | \[ \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}
\] |
sub-neg [=>]56.9 | \[ \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) \cdot \frac{\color{blue}{x + \left(-2\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
metadata-eval [=>]56.9 | \[ \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) \cdot \frac{x + \color{blue}{-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 1.4
Simplified1.4
[Start]1.4 | \[ \left(-1 \cdot \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} + \left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right)\right) - 110.1139242984811
\] |
|---|---|
sub-neg [=>]1.4 | \[ \color{blue}{\left(-1 \cdot \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} + \left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right)\right) + \left(-110.1139242984811\right)}
\] |
+-commutative [=>]1.4 | \[ \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) + -1 \cdot \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)} + \left(-110.1139242984811\right)
\] |
mul-1-neg [=>]1.4 | \[ \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) + \color{blue}{\left(-\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)}\right) + \left(-110.1139242984811\right)
\] |
unsub-neg [=>]1.4 | \[ \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)} + \left(-110.1139242984811\right)
\] |
associate-+l- [=>]1.4 | \[ \color{blue}{\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)}
\] |
*-commutative [=>]1.4 | \[ \left(\color{blue}{x \cdot 4.16438922228} + 3655.1204654076414 \cdot \frac{1}{x}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
fma-def [=>]1.4 | \[ \color{blue}{\mathsf{fma}\left(x, 4.16438922228, 3655.1204654076414 \cdot \frac{1}{x}\right)} - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
associate-*r/ [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \color{blue}{\frac{3655.1204654076414 \cdot 1}{x}}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
metadata-eval [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{\color{blue}{3655.1204654076414}}{x}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
mul-1-neg [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{130977.50649958357 + \color{blue}{\left(-y\right)}}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
unsub-neg [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\color{blue}{130977.50649958357 - y}}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
unpow2 [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{130977.50649958357 - y}{\color{blue}{x \cdot x}} - \left(-110.1139242984811\right)\right)
\] |
metadata-eval [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{130977.50649958357 - y}{x \cdot x} - \color{blue}{-110.1139242984811}\right)
\] |
Applied egg-rr1.4
Simplified1.4
[Start]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\left(-130977.50649958357 + y\right) \cdot \frac{1}{x \cdot \left(-x\right)} - -110.1139242984811\right)
\] |
|---|---|
associate-*r/ [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\color{blue}{\frac{\left(-130977.50649958357 + y\right) \cdot 1}{x \cdot \left(-x\right)}} - -110.1139242984811\right)
\] |
*-commutative [<=]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\color{blue}{1 \cdot \left(-130977.50649958357 + y\right)}}{x \cdot \left(-x\right)} - -110.1139242984811\right)
\] |
associate-/r* [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\color{blue}{\frac{\frac{1 \cdot \left(-130977.50649958357 + y\right)}{x}}{-x}} - -110.1139242984811\right)
\] |
*-lft-identity [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{-130977.50649958357 + y}}{x}}{-x} - -110.1139242984811\right)
\] |
metadata-eval [<=]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{\left(0 - 130977.50649958357\right)} + y}{x}}{-x} - -110.1139242984811\right)
\] |
associate--r- [<=]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{0 - \left(130977.50649958357 - y\right)}}{x}}{-x} - -110.1139242984811\right)
\] |
neg-sub0 [<=]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{-\left(130977.50649958357 - y\right)}}{x}}{-x} - -110.1139242984811\right)
\] |
neg-sub0 [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{0 - \left(130977.50649958357 - y\right)}}{x}}{-x} - -110.1139242984811\right)
\] |
associate--r- [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{\left(0 - 130977.50649958357\right) + y}}{x}}{-x} - -110.1139242984811\right)
\] |
metadata-eval [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{-130977.50649958357} + y}{x}}{-x} - -110.1139242984811\right)
\] |
+-commutative [=>]1.4 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\frac{\color{blue}{y + -130977.50649958357}}{x}}{-x} - -110.1139242984811\right)
\] |
if -1.05000000000000001e43 < x < 7.8e15Initial program 0.8
Simplified0.4
[Start]0.8 | \[ \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/ [<=]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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 [=>]0.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}
\] |
if 7.8e15 < x Initial program 56.3
Simplified52.1
[Start]56.3 | \[ \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-*l/ [<=]52.1 | \[ \color{blue}{\frac{x - 2}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \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)}
\] |
*-commutative [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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 [=>]52.1 | \[ \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}
\] |
sub-neg [=>]52.1 | \[ \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) \cdot \frac{\color{blue}{x + \left(-2\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\] |
metadata-eval [=>]52.1 | \[ \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) \cdot \frac{x + \color{blue}{-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 3.0
Simplified3.0
[Start]3.0 | \[ \left(-1 \cdot \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} + \left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right)\right) - 110.1139242984811
\] |
|---|---|
sub-neg [=>]3.0 | \[ \color{blue}{\left(-1 \cdot \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} + \left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right)\right) + \left(-110.1139242984811\right)}
\] |
+-commutative [=>]3.0 | \[ \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) + -1 \cdot \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)} + \left(-110.1139242984811\right)
\] |
mul-1-neg [=>]3.0 | \[ \left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) + \color{blue}{\left(-\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)}\right) + \left(-110.1139242984811\right)
\] |
unsub-neg [=>]3.0 | \[ \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - \frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)} + \left(-110.1139242984811\right)
\] |
associate-+l- [=>]3.0 | \[ \color{blue}{\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)}
\] |
*-commutative [=>]3.0 | \[ \left(\color{blue}{x \cdot 4.16438922228} + 3655.1204654076414 \cdot \frac{1}{x}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
fma-def [=>]3.0 | \[ \color{blue}{\mathsf{fma}\left(x, 4.16438922228, 3655.1204654076414 \cdot \frac{1}{x}\right)} - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
associate-*r/ [=>]3.0 | \[ \mathsf{fma}\left(x, 4.16438922228, \color{blue}{\frac{3655.1204654076414 \cdot 1}{x}}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
metadata-eval [=>]3.0 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{\color{blue}{3655.1204654076414}}{x}\right) - \left(\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
mul-1-neg [=>]3.0 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{130977.50649958357 + \color{blue}{\left(-y\right)}}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
unsub-neg [=>]3.0 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{\color{blue}{130977.50649958357 - y}}{{x}^{2}} - \left(-110.1139242984811\right)\right)
\] |
unpow2 [=>]3.0 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{130977.50649958357 - y}{\color{blue}{x \cdot x}} - \left(-110.1139242984811\right)\right)
\] |
metadata-eval [=>]3.0 | \[ \mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) - \left(\frac{130977.50649958357 - y}{x \cdot x} - \color{blue}{-110.1139242984811}\right)
\] |
Taylor expanded in x around inf 3.0
Simplified3.0
[Start]3.0 | \[ 4.16438922228 \cdot x - \left(\frac{130977.50649958357 - y}{x \cdot x} - -110.1139242984811\right)
\] |
|---|---|
*-commutative [<=]3.0 | \[ \color{blue}{x \cdot 4.16438922228} - \left(\frac{130977.50649958357 - y}{x \cdot x} - -110.1139242984811\right)
\] |
Final simplification1.2
| Alternative 1 | |
|---|---|
| Error | 1.3 |
| Cost | 10632 |
| Alternative 2 | |
|---|---|
| Error | 1.2 |
| Cost | 7556 |
| Alternative 3 | |
|---|---|
| Error | 1.3 |
| Cost | 3657 |
| Alternative 4 | |
|---|---|
| Error | 2.4 |
| Cost | 2121 |
| Alternative 5 | |
|---|---|
| Error | 4.6 |
| Cost | 1993 |
| Alternative 6 | |
|---|---|
| Error | 4.9 |
| Cost | 1353 |
| Alternative 7 | |
|---|---|
| Error | 14.1 |
| Cost | 1225 |
| Alternative 8 | |
|---|---|
| Error | 13.8 |
| Cost | 1097 |
| Alternative 9 | |
|---|---|
| Error | 15.7 |
| Cost | 1096 |
| Alternative 10 | |
|---|---|
| Error | 15.8 |
| Cost | 840 |
| Alternative 11 | |
|---|---|
| Error | 15.8 |
| Cost | 713 |
| Alternative 12 | |
|---|---|
| Error | 16.3 |
| Cost | 585 |
| Alternative 13 | |
|---|---|
| Error | 16.4 |
| Cost | 584 |
| Alternative 14 | |
|---|---|
| Error | 16.5 |
| Cost | 456 |
| Alternative 15 | |
|---|---|
| Error | 35.5 |
| Cost | 192 |
herbie shell --seed 2023018
(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)))