?

Average Error: 41.29% → 1.27%
Time: 24.9s
Precision: binary64
Cost: 17417

?

\[\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 := 313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\\ t_1 := 47.066876606 + x \cdot t_0\\ \mathbf{if}\;x \leq -4.1 \cdot 10^{+71} \lor \neg \left(x \leq 2.2 \cdot 10^{+56}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(x \cdot \frac{y}{\mathsf{fma}\left(t_0, x, 47.066876606\right)} + \left(\frac{{x}^{2} \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)}{t_1} + \frac{z}{t_1}\right)\right)\\ \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
         (+ 313.399215894 (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))
        (t_1 (+ 47.066876606 (* x t_0))))
   (if (or (<= x -4.1e+71) (not (<= x 2.2e+56)))
     (/ (+ x -2.0) 0.24013125253755718)
     (*
      (+ x -2.0)
      (+
       (* x (/ y (fma t_0 x 47.066876606)))
       (+
        (/
         (*
          (pow x 2.0)
          (+ 137.519416416 (* x (+ 78.6994924154 (* x 4.16438922228)))))
         t_1)
        (/ z 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 = 313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))));
	double t_1 = 47.066876606 + (x * t_0);
	double tmp;
	if ((x <= -4.1e+71) || !(x <= 2.2e+56)) {
		tmp = (x + -2.0) / 0.24013125253755718;
	} else {
		tmp = (x + -2.0) * ((x * (y / fma(t_0, x, 47.066876606))) + (((pow(x, 2.0) * (137.519416416 + (x * (78.6994924154 + (x * 4.16438922228))))) / t_1) + (z / 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 = Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))
	t_1 = Float64(47.066876606 + Float64(x * t_0))
	tmp = 0.0
	if ((x <= -4.1e+71) || !(x <= 2.2e+56))
		tmp = Float64(Float64(x + -2.0) / 0.24013125253755718);
	else
		tmp = Float64(Float64(x + -2.0) * Float64(Float64(x * Float64(y / fma(t_0, x, 47.066876606))) + Float64(Float64(Float64((x ^ 2.0) * Float64(137.519416416 + Float64(x * Float64(78.6994924154 + Float64(x * 4.16438922228))))) / t_1) + Float64(z / 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[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(47.066876606 + N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -4.1e+71], N[Not[LessEqual[x, 2.2e+56]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(x * N[(y / N[(t$95$0 * x + 47.066876606), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Power[x, 2.0], $MachinePrecision] * N[(137.519416416 + N[(x * N[(78.6994924154 + N[(x * 4.16438922228), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $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 := 313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\\
t_1 := 47.066876606 + x \cdot t_0\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+71} \lor \neg \left(x \leq 2.2 \cdot 10^{+56}\right):\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\

\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(x \cdot \frac{y}{\mathsf{fma}\left(t_0, x, 47.066876606\right)} + \left(\frac{{x}^{2} \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)}{t_1} + \frac{z}{t_1}\right)\right)\\


\end{array}

Error?

Target

Original41.29%
Target1.44%
Herbie1.27%
\[\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 < -4.1000000000000002e71 or 2.20000000000000016e56 < x

    1. Initial program 99.34

      \[\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. Simplified95.3

      \[\leadsto \color{blue}{\frac{x + -2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{\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)}}} \]
      Proof

      [Start]99.34

      \[ \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* [=>]95.3

      \[ \color{blue}{\frac{x - 2}{\frac{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}}} \]

      sub-neg [=>]95.3

      \[ \frac{\color{blue}{x + \left(-2\right)}}{\frac{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}} \]

      metadata-eval [=>]95.3

      \[ \frac{x + \color{blue}{-2}}{\frac{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}} \]

      fma-def [=>]95.3

      \[ \frac{x + -2}{\frac{\color{blue}{\mathsf{fma}\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894, x, 47.066876606\right)}}{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}} \]

      fma-def [=>]95.3

      \[ \frac{x + -2}{\frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721, x, 313.399215894\right)}, x, 47.066876606\right)}{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}} \]

      fma-def [=>]95.3

      \[ \frac{x + -2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right)}, x, 313.399215894\right), x, 47.066876606\right)}{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}} \]

      fma-def [=>]95.3

      \[ \frac{x + -2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y, x, z\right)}}} \]

      fma-def [=>]95.3

      \[ \frac{x + -2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416, x, y\right)}, x, z\right)}} \]

      fma-def [=>]95.3

      \[ \frac{x + -2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot 4.16438922228 + 78.6994924154, x, 137.519416416\right)}, x, y\right), x, z\right)}} \]

      fma-def [=>]95.3

      \[ \frac{x + -2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right)}, x, 137.519416416\right), x, y\right), x, z\right)}} \]
    3. Taylor expanded in x around inf 2.53

      \[\leadsto \frac{x + -2}{\color{blue}{0.24013125253755718}} \]

    if -4.1000000000000002e71 < x < 2.20000000000000016e56

    1. Initial program 3.97

      \[\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. Simplified1.51

      \[\leadsto \color{blue}{\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)}} \]
      Proof

      [Start]3.97

      \[ \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/ [<=]1.52

      \[ \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 [=>]1.52

      \[ \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 [=>]1.52

      \[ \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 [=>]1.52

      \[ \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 [=>]1.51

      \[ \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 [=>]1.51

      \[ \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 [=>]1.51

      \[ \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 [=>]1.51

      \[ \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 [=>]1.51

      \[ \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 [=>]1.51

      \[ \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 [=>]1.51

      \[ \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} \]
    3. Taylor expanded in y around 0 1.51

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{y \cdot x}{\left(313.399215894 + \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right) \cdot x\right) \cdot x + 47.066876606} + \left(\frac{\left(137.519416416 + \left(78.6994924154 + 4.16438922228 \cdot x\right) \cdot x\right) \cdot {x}^{2}}{\left(313.399215894 + \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right) \cdot x\right) \cdot x + 47.066876606} + \frac{z}{\left(313.399215894 + \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right) \cdot x\right) \cdot x + 47.066876606}\right)\right)} \]
    4. Applied egg-rr0.46

      \[\leadsto \left(x + -2\right) \cdot \left(\color{blue}{\frac{y}{\mathsf{fma}\left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right), x, 47.066876606\right)} \cdot x} + \left(\frac{\left(137.519416416 + \left(78.6994924154 + 4.16438922228 \cdot x\right) \cdot x\right) \cdot {x}^{2}}{\left(313.399215894 + \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right) \cdot x\right) \cdot x + 47.066876606} + \frac{z}{\left(313.399215894 + \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right) \cdot x\right) \cdot x + 47.066876606}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.27

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{+71} \lor \neg \left(x \leq 2.2 \cdot 10^{+56}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(x \cdot \frac{y}{\mathsf{fma}\left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right), x, 47.066876606\right)} + \left(\frac{{x}^{2} \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error1.34%
Cost15172
\[\begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := \frac{z}{t_0}\\ \mathbf{if}\;x \leq -5.8 \cdot 10^{+15}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(-43.3400022514 \cdot \frac{y}{{x}^{4}} + \frac{y}{{x}^{3}}\right) + \left(4.16438922228 + t_1\right)\right)\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+56}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(\frac{{x}^{2} \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)}{t_0} + t_1\right) + \frac{x \cdot y}{t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \end{array} \]
Alternative 2
Error1.49%
Cost11144
\[\begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := \frac{z}{t_0}\\ \mathbf{if}\;x \leq -45000000000000:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(4.16438922228 + t_1\right) + x \cdot \frac{y}{t_0}\right)\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+56}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\left(\frac{{x}^{2} \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)}{t_0} + t_1\right) + \frac{x \cdot y}{t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \end{array} \]
Alternative 3
Error1.91%
Cost3528
\[\begin{array}{l} t_0 := x \cdot \left(x + 43.3400022514\right)\\ t_1 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_0\right)\right)\\ t_2 := 4.16438922228 + \frac{z}{t_1}\\ \mathbf{if}\;x \leq -2800000:\\ \;\;\;\;\left(x + -2\right) \cdot \left(t_2 + x \cdot \frac{y}{t_1}\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+39}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + \frac{x \cdot \left(t_0 \cdot t_0 + -69434.9244037198\right)}{t_0 + -263.505074721}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot t_2\\ \end{array} \]
Alternative 4
Error1.9%
Cost2884
\[\begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := 4.16438922228 + \frac{z}{t_0}\\ \mathbf{if}\;x \leq -230000:\\ \;\;\;\;\left(x + -2\right) \cdot \left(t_1 + x \cdot \frac{y}{t_0}\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+41}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)\right)}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot t_1\\ \end{array} \]
Alternative 5
Error2.99%
Cost2633
\[\begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{+46} \lor \neg \left(x \leq 6 \cdot 10^{+40}\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)\right)}{t_0}\\ \end{array} \]
Alternative 6
Error4.94%
Cost2121
\[\begin{array}{l} t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ \mathbf{if}\;x \leq -1.85 \cdot 10^{+18} \lor \neg \left(x \leq 1.05 \cdot 10^{+28}\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{t_0}\\ \end{array} \]
Alternative 7
Error6.49%
Cost1993
\[\begin{array}{l} \mathbf{if}\;x \leq -0.023 \lor \neg \left(x \leq 2 \cdot 10^{-24}\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot 78.6994924154\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\ \end{array} \]
Alternative 8
Error9.15%
Cost1737
\[\begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-9} \lor \neg \left(x \leq 2 \cdot 10^{-24}\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 + x \cdot \left(y \cdot 0.0212463641547976 + z \cdot -0.14147091005106402\right)\right)\\ \end{array} \]
Alternative 9
Error6.56%
Cost1737
\[\begin{array}{l} \mathbf{if}\;x \leq -0.042 \lor \neg \left(x \leq 2 \cdot 10^{-24}\right):\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\ \end{array} \]
Alternative 10
Error11.76%
Cost1353
\[\begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+17} \lor \neg \left(x \leq 3.5 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 + x \cdot \left(y \cdot 0.0212463641547976 + z \cdot -0.14147091005106402\right)\right)\\ \end{array} \]
Alternative 11
Error24.03%
Cost1225
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-10} \lor \neg \left(x \leq 3.5 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\ \end{array} \]
Alternative 12
Error24.08%
Cost969
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-10} \lor \neg \left(x \leq 3.5 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot z}{47.066876606 + x \cdot 313.399215894}\\ \end{array} \]
Alternative 13
Error24.33%
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-10} \lor \neg \left(x \leq 3.5 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976\right)\\ \end{array} \]
Alternative 14
Error24.3%
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-10} \lor \neg \left(x \leq 3.5 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{\frac{47.066876606}{z}}\\ \end{array} \]
Alternative 15
Error24.4%
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-10} \lor \neg \left(x \leq 3.5 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \end{array} \]
Alternative 16
Error24.63%
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-10}:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+23}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228\\ \end{array} \]
Alternative 17
Error97.73%
Cost192
\[x \cdot -0.3407596943375357 \]
Alternative 18
Error55.96%
Cost192
\[x \cdot 4.16438922228 \]

Error

Reproduce?

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