?

Average Error: 27.0 → 1.0
Time: 1.8min
Precision: binary64
Cost: 46796

?

\[\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 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\ t_1 := \mathsf{fma}\left(\sqrt{4.16438922228}, \sqrt{4.16438922228} \cdot x, \frac{\frac{-130977.50649958357 + y}{x} + 3655.1204654076414}{x}\right) - 110.1139242984811\\ t_2 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)\\ \mathbf{if}\;x \leq -1.45 \cdot 10^{+72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+20}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;x - 2 \ne 0:\\ \;\;\;\;\frac{t_2}{\frac{t_0}{x - 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_2 \cdot \left(x - 2\right)}{t_0}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
(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
         (fma
          (fma (fma (+ 43.3400022514 x) x 263.505074721) x 313.399215894)
          x
          47.066876606))
        (t_1
         (-
          (fma
           (sqrt 4.16438922228)
           (* (sqrt 4.16438922228) x)
           (/ (+ (/ (+ -130977.50649958357 y) x) 3655.1204654076414) x))
          110.1139242984811))
        (t_2
         (fma
          (fma (fma (fma x 4.16438922228 78.6994924154) x 137.519416416) x y)
          x
          z)))
   (if (<= x -1.45e+72)
     t_1
     (if (<= x 5.5e+20)
       (if (!= (- x 2.0) 0.0)
         (/ t_2 (/ t_0 (- x 2.0)))
         (/ (* t_2 (- x 2.0)) t_0))
       t_1))))
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 = fma(fma(fma((43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606);
	double t_1 = fma(sqrt(4.16438922228), (sqrt(4.16438922228) * x), ((((-130977.50649958357 + y) / x) + 3655.1204654076414) / x)) - 110.1139242984811;
	double t_2 = fma(fma(fma(fma(x, 4.16438922228, 78.6994924154), x, 137.519416416), x, y), x, z);
	double tmp;
	if (x <= -1.45e+72) {
		tmp = t_1;
	} else if (x <= 5.5e+20) {
		double tmp_1;
		if ((x - 2.0) != 0.0) {
			tmp_1 = t_2 / (t_0 / (x - 2.0));
		} else {
			tmp_1 = (t_2 * (x - 2.0)) / t_0;
		}
		tmp = tmp_1;
	} else {
		tmp = t_1;
	}
	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 = fma(fma(fma(Float64(43.3400022514 + x), x, 263.505074721), x, 313.399215894), x, 47.066876606)
	t_1 = Float64(fma(sqrt(4.16438922228), Float64(sqrt(4.16438922228) * x), Float64(Float64(Float64(Float64(-130977.50649958357 + y) / x) + 3655.1204654076414) / x)) - 110.1139242984811)
	t_2 = fma(fma(fma(fma(x, 4.16438922228, 78.6994924154), x, 137.519416416), x, y), x, z)
	tmp = 0.0
	if (x <= -1.45e+72)
		tmp = t_1;
	elseif (x <= 5.5e+20)
		tmp_1 = 0.0
		if (Float64(x - 2.0) != 0.0)
			tmp_1 = Float64(t_2 / Float64(t_0 / Float64(x - 2.0)));
		else
			tmp_1 = Float64(Float64(t_2 * Float64(x - 2.0)) / t_0);
		end
		tmp = tmp_1;
	else
		tmp = t_1;
	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[(43.3400022514 + x), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[4.16438922228], $MachinePrecision] * N[(N[Sqrt[4.16438922228], $MachinePrecision] * x), $MachinePrecision] + N[(N[(N[(N[(-130977.50649958357 + y), $MachinePrecision] / x), $MachinePrecision] + 3655.1204654076414), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x * 4.16438922228 + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * x + y), $MachinePrecision] * x + z), $MachinePrecision]}, If[LessEqual[x, -1.45e+72], t$95$1, If[LessEqual[x, 5.5e+20], If[Unequal[N[(x - 2.0), $MachinePrecision], 0.0], N[(t$95$2 / N[(t$95$0 / N[(x - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 * N[(x - 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]], t$95$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(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\begin{array}{l}
t_0 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)\\
t_1 := \mathsf{fma}\left(\sqrt{4.16438922228}, \sqrt{4.16438922228} \cdot x, \frac{\frac{-130977.50649958357 + y}{x} + 3655.1204654076414}{x}\right) - 110.1139242984811\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+72}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+20}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;x - 2 \ne 0:\\
\;\;\;\;\frac{t_2}{\frac{t_0}{x - 2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_2 \cdot \left(x - 2\right)}{t_0}\\


\end{array}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error?

Target

Original27.0
Target0.8
Herbie1.0
\[\begin{array}{l} \mathbf{if}\;x < -3.326128725870005 \cdot 10^{+62}:\\ \;\;\;\;\left(\frac{y}{x \cdot x} + 4.16438922228 \cdot x\right) - 110.1139242984811\\ \mathbf{elif}\;x < 9.429991714554673 \cdot 10^{+55}:\\ \;\;\;\;\frac{x - 2}{1} \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(263.505074721 \cdot x + \left(43.3400022514 \cdot \left(x \cdot x\right) + x \cdot \left(x \cdot x\right)\right)\right) + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y}{x \cdot x} + 4.16438922228 \cdot x\right) - 110.1139242984811\\ \end{array} \]

Derivation?

  1. Split input into 2 regimes
  2. if x < -1.45000000000000009e72 or 5.5e20 < x

    1. Initial program 60.4

      \[\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} \]
    2. Taylor expanded in x around inf 1.6

      \[\leadsto \color{blue}{\left(4.16438922228 \cdot x + \left(\left(y - 130977.50649958357\right) \cdot {\left(\frac{1}{x}\right)}^{2} + 3655.1204654076414 \cdot \frac{1}{x}\right)\right) - 110.1139242984811} \]
    3. Simplified1.6

      \[\leadsto \color{blue}{\mathsf{fma}\left(4.16438922228, x, \mathsf{fma}\left(y - 130977.50649958357, \frac{{x}^{-1}}{x}, \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811} \]
      Proof
    4. Applied egg-rr1.4

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{4.16438922228}, \sqrt{4.16438922228} \cdot x, \frac{\frac{-130977.50649958357 + y}{x} + 3655.1204654076414}{x}\right)} - 110.1139242984811 \]

    if -1.45000000000000009e72 < x < 5.5e20

    1. Initial program 2.4

      \[\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} \]
    2. Applied egg-rr0.7

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;x + -2 \ne 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{x + -2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right) \cdot \left(x + -2\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}\\ } \end{array}} \]
    3. Simplified0.7

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;x - 2 \ne 0:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{x - 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right) \cdot \left(x - 2\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}\\ } \end{array}} \]
      Proof
  3. Recombined 2 regimes into one program.

Alternatives

Alternative 1
Error1.0
Cost46536
\[\begin{array}{l} t_0 := \mathsf{fma}\left(\sqrt{4.16438922228}, \sqrt{4.16438922228} \cdot x, \frac{\frac{-130977.50649958357 + y}{x} + 3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{+65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+20}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right) \cdot \frac{x + -2}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(43.3400022514 + x, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error1.3
Cost25032
\[\begin{array}{l} t_0 := \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}\\ t_1 := \sqrt[3]{17.342137594641823} \cdot x\\ t_2 := 47.066876606 + \left(313.399215894 + \left(\left(43.3400022514 + x\right) \cdot x + 263.505074721\right) \cdot x\right) \cdot x\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\sqrt[3]{4.16438922228} \cdot t_1\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\frac{\left(\left(137.519416416 + \left(78.6994924154 + x \cdot \sqrt[3]{72.2194108904232}\right) \cdot x\right) \cdot x + y\right) \cdot \left(\left(x - 2\right) \cdot x\right)}{t_2} + \frac{z \cdot \left(x - 2\right)}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt[3]{4.16438922228}, t_1, \frac{\frac{-130977.50649958357 + y}{x} + 3655.1204654076414}{x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 3
Error1.3
Cost25032
\[\begin{array}{l} t_0 := \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}\\ t_1 := 47.066876606 + \left(313.399215894 + \left(\left(43.3400022514 + x\right) \cdot x + 263.505074721\right) \cdot x\right) \cdot x\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\sqrt[3]{4.16438922228} \cdot \left(\sqrt[3]{17.342137594641823} \cdot x\right)\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\frac{\left(\left(137.519416416 + \left(78.6994924154 + x \cdot \sqrt[3]{72.2194108904232}\right) \cdot x\right) \cdot x + y\right) \cdot \left(\left(x - 2\right) \cdot x\right)}{t_1} + \frac{z \cdot \left(x - 2\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{4.16438922228}, \sqrt{4.16438922228} \cdot x, \frac{\frac{-130977.50649958357 + y}{x} + 3655.1204654076414}{x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 4
Error1.4
Cost24968
\[\begin{array}{l} t_0 := \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}\\ t_1 := 47.066876606 + \left(313.399215894 + \left(\left(43.3400022514 + x\right) \cdot x + 263.505074721\right) \cdot x\right) \cdot x\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\sqrt[3]{4.16438922228} \cdot \left(\sqrt[3]{17.342137594641823} \cdot x\right)\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\frac{\left(\left(137.519416416 + \left(78.6994924154 + x \cdot \sqrt[3]{72.2194108904232}\right) \cdot x\right) \cdot x + y\right) \cdot \left(\left(x - 2\right) \cdot x\right)}{t_1} + \frac{z \cdot \left(x - 2\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(4.16438922228, x, \mathsf{fma}\left(y - 130977.50649958357, \frac{{x}^{-1}}{x}, \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\ \end{array} \]
Alternative 5
Error1.4
Cost15556
\[\begin{array}{l} t_0 := \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}\\ t_1 := 47.066876606 + \left(313.399215894 + \left(\left(43.3400022514 + x\right) \cdot x + 263.505074721\right) \cdot x\right) \cdot x\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\sqrt[3]{4.16438922228} \cdot \left(\sqrt[3]{17.342137594641823} \cdot x\right)\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\frac{\left(\left(137.519416416 + \left(78.6994924154 + x \cdot \sqrt[3]{72.2194108904232}\right) \cdot x\right) \cdot x + y\right) \cdot \left(\left(x - 2\right) \cdot x\right)}{t_1} + \frac{z \cdot \left(x - 2\right)}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(4.16438922228, x, \frac{y}{x \cdot x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 6
Error1.4
Cost14920
\[\begin{array}{l} t_0 := 47.066876606 + \left(313.399215894 + \left(\left(43.3400022514 + x\right) \cdot x + 263.505074721\right) \cdot x\right) \cdot x\\ t_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(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\frac{\left(\left(137.519416416 + \left(78.6994924154 + x \cdot \sqrt[3]{72.2194108904232}\right) \cdot x\right) \cdot x + y\right) \cdot \left(\left(x - 2\right) \cdot x\right)}{t_0} + \frac{z \cdot \left(x - 2\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(4.16438922228, x, \frac{y}{x \cdot x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 7
Error1.4
Cost11848
\[\begin{array}{l} t_0 := 47.066876606 + \left(313.399215894 + \left(\left(43.3400022514 + x\right) \cdot x + 263.505074721\right) \cdot x\right) \cdot x\\ t_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(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\frac{\left(\left(137.519416416 + \left(78.6994924154 + 4.16438922228 \cdot x\right) \cdot x\right) \cdot x + y\right) \cdot \left(x \cdot \left(x - 2\right)\right)}{t_0} + \frac{z \cdot \left(x - 2\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(4.16438922228, x, \frac{y}{x \cdot x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 8
Error1.4
Cost8520
\[\begin{array}{l} t_0 := 47.066876606 + \left(313.399215894 + \left(\left(43.3400022514 + x\right) \cdot x + 263.505074721\right) \cdot x\right) \cdot x\\ t_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(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\frac{\left(\left(137.519416416 + \left(78.6994924154 + 4.16438922228 \cdot x\right) \cdot x\right) \cdot x + y\right) \cdot \left(x \cdot \left(x - 2\right)\right)}{t_0} + \frac{z \cdot \left(x - 2\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 9
Error1.4
Cost7240
\[\begin{array}{l} t_0 := \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}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 10
Error2.4
Cost2120
\[\begin{array}{l} t_0 := \left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -5 \cdot 10^{+28}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+14}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(137.519416416 \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}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error2.8
Cost1992
\[\begin{array}{l} t_0 := \left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -62:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 92:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(x \cdot \left(x \cdot 78.6994924154 + 137.519416416\right) + y\right) \cdot x + z\right)}{\left(263.505074721 \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error2.9
Cost1736
\[\begin{array}{l} t_0 := \left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -5.5:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 132:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(137.519416416 \cdot x + y\right) \cdot x + z\right)}{\left(263.505074721 \cdot x + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error14.0
Cost1488
\[\begin{array}{l} t_0 := \frac{z \cdot \left(x - 2\right)}{\left(313.399215894 + 263.505074721 \cdot x\right) \cdot x + 47.066876606}\\ t_1 := \left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -28:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.25 \cdot 10^{-142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{-41}:\\ \;\;\;\;\frac{y \cdot \left(\left(x - 2\right) \cdot x\right)}{313.399215894 \cdot x + 47.066876606}\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-12}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error3.0
Cost1480
\[\begin{array}{l} t_0 := \left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -36:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 90:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(137.519416416 \cdot x + y\right) \cdot x + z\right)}{x \cdot 313.399215894 + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 15
Error14.3
Cost1356
\[\begin{array}{l} t_0 := \left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -37:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-142}:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{elif}\;x \leq 0.32:\\ \;\;\;\;\frac{y \cdot \left(\left(x - 2\right) \cdot x\right)}{313.399215894 \cdot x + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 16
Error4.7
Cost1352
\[\begin{array}{l} t_0 := \left(4.16438922228 \cdot x - \frac{\frac{130977.50649958357 - y}{x} + -3655.1204654076414}{x}\right) - 110.1139242984811\\ \mathbf{if}\;x \leq -0.19:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.42:\\ \;\;\;\;\left(0.0212463641547976 \cdot \left(-2 \cdot y + z\right) - -0.28294182010212804 \cdot z\right) \cdot x + -0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error16.3
Cost1228
\[\begin{array}{l} \mathbf{if}\;x \leq -58000000:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{-142}:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{elif}\;x \leq 0.42:\\ \;\;\;\;\frac{y \cdot \left(\left(x - 2\right) \cdot x\right)}{313.399215894 \cdot x + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot x - 110.1139242984811\\ \end{array} \]
Alternative 18
Error16.2
Cost848
\[\begin{array}{l} \mathbf{if}\;x \leq -60000000:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-142}:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-43}:\\ \;\;\;\;-0.0424927283095952 \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-12}:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot x - 110.1139242984811\\ \end{array} \]
Alternative 19
Error16.2
Cost848
\[\begin{array}{l} \mathbf{if}\;x \leq -200000000:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-143}:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-43}:\\ \;\;\;\;-0.0424927283095952 \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-12}:\\ \;\;\;\;\frac{z}{\frac{1}{-0.0424927283095952}}\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot x - 110.1139242984811\\ \end{array} \]
Alternative 20
Error16.4
Cost716
\[\begin{array}{l} \mathbf{if}\;x \leq -58000000:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{-142}:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;-0.0424927283095952 \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot x\\ \end{array} \]
Alternative 21
Error15.0
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -58000000:\\ \;\;\;\;4.16438922228 \cdot x\\ \mathbf{elif}\;x \leq 3300000000:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot x\\ \end{array} \]
Alternative 22
Error41.8
Cost192
\[-0.0424927283095952 \cdot z \]

Error

Reproduce?

herbie shell --seed 2023033 
(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)))