| Alternative 1 | |
|---|---|
| Error | 2.27% |
| Cost | 2632 |
(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.15e+17)
(+
(+ (/ 3655.1204654076414 x) (* x 4.16438922228))
(+ -110.1139242984811 (* (- 130977.50649958357 y) (/ -1.0 (* x x)))))
(if (<= x 3.2e+16)
(/
(*
(+
(*
x
(+
y
(*
x
(- 137.519416416 (* x (- -78.6994924154 (* x 4.16438922228)))))))
z)
(+ x -2.0))
(+
(*
x
(+
(+ (* x (* x (+ x 43.3400022514))) (* x 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.15e+17) {
tmp = ((3655.1204654076414 / x) + (x * 4.16438922228)) + (-110.1139242984811 + ((130977.50649958357 - y) * (-1.0 / (x * x))));
} else if (x <= 3.2e+16) {
tmp = (((x * (y + (x * (137.519416416 - (x * (-78.6994924154 - (x * 4.16438922228))))))) + z) * (x + -2.0)) / ((x * (((x * (x * (x + 43.3400022514))) + (x * 263.505074721)) + 313.399215894)) + 47.066876606);
} else {
tmp = (x * 4.16438922228) - (((130977.50649958357 - y) / (x * x)) + 110.1139242984811);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.15d+17)) then
tmp = ((3655.1204654076414d0 / x) + (x * 4.16438922228d0)) + ((-110.1139242984811d0) + ((130977.50649958357d0 - y) * ((-1.0d0) / (x * x))))
else if (x <= 3.2d+16) then
tmp = (((x * (y + (x * (137.519416416d0 - (x * ((-78.6994924154d0) - (x * 4.16438922228d0))))))) + z) * (x + (-2.0d0))) / ((x * (((x * (x * (x + 43.3400022514d0))) + (x * 263.505074721d0)) + 313.399215894d0)) + 47.066876606d0)
else
tmp = (x * 4.16438922228d0) - (((130977.50649958357d0 - y) / (x * x)) + 110.1139242984811d0)
end if
code = tmp
end function
public static 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);
}
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.15e+17) {
tmp = ((3655.1204654076414 / x) + (x * 4.16438922228)) + (-110.1139242984811 + ((130977.50649958357 - y) * (-1.0 / (x * x))));
} else if (x <= 3.2e+16) {
tmp = (((x * (y + (x * (137.519416416 - (x * (-78.6994924154 - (x * 4.16438922228))))))) + z) * (x + -2.0)) / ((x * (((x * (x * (x + 43.3400022514))) + (x * 263.505074721)) + 313.399215894)) + 47.066876606);
} else {
tmp = (x * 4.16438922228) - (((130977.50649958357 - y) / (x * x)) + 110.1139242984811);
}
return tmp;
}
def code(x, y, 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)
def code(x, y, z): tmp = 0 if x <= -1.15e+17: tmp = ((3655.1204654076414 / x) + (x * 4.16438922228)) + (-110.1139242984811 + ((130977.50649958357 - y) * (-1.0 / (x * x)))) elif x <= 3.2e+16: tmp = (((x * (y + (x * (137.519416416 - (x * (-78.6994924154 - (x * 4.16438922228))))))) + z) * (x + -2.0)) / ((x * (((x * (x * (x + 43.3400022514))) + (x * 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.15e+17) tmp = Float64(Float64(Float64(3655.1204654076414 / x) + Float64(x * 4.16438922228)) + Float64(-110.1139242984811 + Float64(Float64(130977.50649958357 - y) * Float64(-1.0 / Float64(x * x))))); elseif (x <= 3.2e+16) tmp = Float64(Float64(Float64(Float64(x * Float64(y + Float64(x * Float64(137.519416416 - Float64(x * Float64(-78.6994924154 - Float64(x * 4.16438922228))))))) + z) * Float64(x + -2.0)) / Float64(Float64(x * Float64(Float64(Float64(x * Float64(x * Float64(x + 43.3400022514))) + Float64(x * 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
function tmp = code(x, y, z) tmp = ((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); end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.15e+17) tmp = ((3655.1204654076414 / x) + (x * 4.16438922228)) + (-110.1139242984811 + ((130977.50649958357 - y) * (-1.0 / (x * x)))); elseif (x <= 3.2e+16) tmp = (((x * (y + (x * (137.519416416 - (x * (-78.6994924154 - (x * 4.16438922228))))))) + z) * (x + -2.0)) / ((x * (((x * (x * (x + 43.3400022514))) + (x * 263.505074721)) + 313.399215894)) + 47.066876606); else tmp = (x * 4.16438922228) - (((130977.50649958357 - y) / (x * x)) + 110.1139242984811); end tmp_2 = 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.15e+17], N[(N[(N[(3655.1204654076414 / x), $MachinePrecision] + N[(x * 4.16438922228), $MachinePrecision]), $MachinePrecision] + N[(-110.1139242984811 + N[(N[(130977.50649958357 - y), $MachinePrecision] * N[(-1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e+16], N[(N[(N[(N[(x * N[(y + N[(x * N[(137.519416416 - N[(x * N[(-78.6994924154 - N[(x * 4.16438922228), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] * N[(x + -2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x * N[(N[(N[(x * N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $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.15 \cdot 10^{+17}:\\
\;\;\;\;\left(\frac{3655.1204654076414}{x} + x \cdot 4.16438922228\right) + \left(-110.1139242984811 + \left(130977.50649958357 - y\right) \cdot \frac{-1}{x \cdot x}\right)\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+16}:\\
\;\;\;\;\frac{\left(x \cdot \left(y + x \cdot \left(137.519416416 - x \cdot \left(-78.6994924154 - x \cdot 4.16438922228\right)\right)\right) + z\right) \cdot \left(x + -2\right)}{x \cdot \left(\left(x \cdot \left(x \cdot \left(x + 43.3400022514\right)\right) + x \cdot 263.505074721\right) + 313.399215894\right) + 47.066876606}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 4.16438922228 - \left(\frac{130977.50649958357 - y}{x \cdot x} + 110.1139242984811\right)\\
\end{array}
Results
| Original | 41.56% |
|---|---|
| Target | 1.44% |
| Herbie | 2.27% |
if x < -1.15e17Initial program 86.84
Simplified79.96
[Start]86.84 | \[ \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/ [<=]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 [=>]79.96 | \[ \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 4.41
Simplified4.41
[Start]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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- [=>]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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/ [=>]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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 [=>]4.41 | \[ \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-rr4.41
Applied egg-rr4.42
Applied egg-rr4.42
if -1.15e17 < x < 3.2e16Initial program 0.65
Applied egg-rr0.65
if 3.2e16 < x Initial program 86.89
Simplified79.72
[Start]86.89 | \[ \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/ [<=]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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 [=>]79.72 | \[ \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.7
Simplified3.7
[Start]3.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7 | \[ \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.7
Simplified3.7
[Start]3.7 | \[ 4.16438922228 \cdot x - \left(\frac{130977.50649958357 - y}{x \cdot x} - -110.1139242984811\right)
\] |
|---|---|
*-commutative [=>]3.7 | \[ \color{blue}{x \cdot 4.16438922228} - \left(\frac{130977.50649958357 - y}{x \cdot x} - -110.1139242984811\right)
\] |
Final simplification2.27
| Alternative 1 | |
|---|---|
| Error | 2.27% |
| Cost | 2632 |
| Alternative 2 | |
|---|---|
| Error | 3.36% |
| Cost | 2248 |
| Alternative 3 | |
|---|---|
| Error | 3.34% |
| Cost | 2120 |
| Alternative 4 | |
|---|---|
| Error | 19.76% |
| Cost | 1356 |
| Alternative 5 | |
|---|---|
| Error | 7.01% |
| Cost | 1353 |
| Alternative 6 | |
|---|---|
| Error | 7.06% |
| Cost | 1353 |
| Alternative 7 | |
|---|---|
| Error | 7.04% |
| Cost | 1352 |
| Alternative 8 | |
|---|---|
| Error | 7.01% |
| Cost | 1352 |
| Alternative 9 | |
|---|---|
| Error | 23.43% |
| Cost | 1232 |
| Alternative 10 | |
|---|---|
| Error | 19.81% |
| Cost | 1228 |
| Alternative 11 | |
|---|---|
| Error | 23.78% |
| Cost | 1104 |
| Alternative 12 | |
|---|---|
| Error | 23.51% |
| Cost | 1104 |
| Alternative 13 | |
|---|---|
| Error | 23.73% |
| Cost | 976 |
| Alternative 14 | |
|---|---|
| Error | 23.73% |
| Cost | 976 |
| Alternative 15 | |
|---|---|
| Error | 24.08% |
| Cost | 848 |
| Alternative 16 | |
|---|---|
| Error | 23.84% |
| Cost | 848 |
| Alternative 17 | |
|---|---|
| Error | 24.28% |
| Cost | 716 |
| Alternative 18 | |
|---|---|
| Error | 24.28% |
| Cost | 588 |
| Alternative 19 | |
|---|---|
| Error | 24.15% |
| Cost | 456 |
| Alternative 20 | |
|---|---|
| Error | 97.74% |
| Cost | 192 |
| Alternative 21 | |
|---|---|
| Error | 55.31% |
| Cost | 192 |
herbie shell --seed 2023090
(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)))