Average Error: 27.0 → 1.3
Time: 19.7s
Precision: binary64
Cost: 47112
\[\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 := x \cdot \left(x + 43.3400022514\right)\\ t_1 := \frac{z}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)}\\ t_2 := \frac{\left(x + -2\right) \cdot \left(17.342137594641823 - {t_1}^{2}\right)}{4.16438922228 - t_1}\\ \mathbf{if}\;x \leq -4.791208594581818 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.128817725001906 \cdot 10^{+59}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + \frac{x \cdot \left(69434.9244037198 - {t_0}^{2}\right)}{263.505074721 - t_0}\right)} + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_0\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \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 (* x (+ x 43.3400022514)))
        (t_1
         (/
          z
          (fma
           x
           (fma x (fma x (+ x 43.3400022514) 263.505074721) 313.399215894)
           47.066876606)))
        (t_2
         (/
          (* (+ x -2.0) (- 17.342137594641823 (pow t_1 2.0)))
          (- 4.16438922228 t_1))))
   (if (<= x -4.791208594581818e+40)
     t_2
     (if (<= x 1.128817725001906e+59)
       (*
        (+ x -2.0)
        (+
         (/
          (*
           x
           (+
            y
            (*
             x
             (+ 137.519416416 (* x (+ 78.6994924154 (* x 4.16438922228)))))))
          (+
           47.066876606
           (*
            x
            (+
             313.399215894
             (/
              (* x (- 69434.9244037198 (pow t_0 2.0)))
              (- 263.505074721 t_0))))))
         (/
          z
          (+
           47.066876606
           (* x (+ 313.399215894 (* x (+ 263.505074721 t_0))))))))
       t_2))))
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 = x * (x + 43.3400022514);
	double t_1 = z / fma(x, fma(x, fma(x, (x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606);
	double t_2 = ((x + -2.0) * (17.342137594641823 - pow(t_1, 2.0))) / (4.16438922228 - t_1);
	double tmp;
	if (x <= -4.791208594581818e+40) {
		tmp = t_2;
	} else if (x <= 1.128817725001906e+59) {
		tmp = (x + -2.0) * (((x * (y + (x * (137.519416416 + (x * (78.6994924154 + (x * 4.16438922228))))))) / (47.066876606 + (x * (313.399215894 + ((x * (69434.9244037198 - pow(t_0, 2.0))) / (263.505074721 - t_0)))))) + (z / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + t_0)))))));
	} else {
		tmp = t_2;
	}
	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(x * Float64(x + 43.3400022514))
	t_1 = Float64(z / fma(x, fma(x, fma(x, Float64(x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606))
	t_2 = Float64(Float64(Float64(x + -2.0) * Float64(17.342137594641823 - (t_1 ^ 2.0))) / Float64(4.16438922228 - t_1))
	tmp = 0.0
	if (x <= -4.791208594581818e+40)
		tmp = t_2;
	elseif (x <= 1.128817725001906e+59)
		tmp = Float64(Float64(x + -2.0) * Float64(Float64(Float64(x * Float64(y + Float64(x * Float64(137.519416416 + Float64(x * Float64(78.6994924154 + Float64(x * 4.16438922228))))))) / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(Float64(x * Float64(69434.9244037198 - (t_0 ^ 2.0))) / Float64(263.505074721 - t_0)))))) + Float64(z / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + t_0))))))));
	else
		tmp = t_2;
	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[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z / N[(x * N[(x * N[(x * N[(x + 43.3400022514), $MachinePrecision] + 263.505074721), $MachinePrecision] + 313.399215894), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x + -2.0), $MachinePrecision] * N[(17.342137594641823 - N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.16438922228 - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.791208594581818e+40], t$95$2, If[LessEqual[x, 1.128817725001906e+59], N[(N[(x + -2.0), $MachinePrecision] * 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] / N[(47.066876606 + N[(x * N[(313.399215894 + N[(N[(x * N[(69434.9244037198 - N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(263.505074721 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\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 := x \cdot \left(x + 43.3400022514\right)\\
t_1 := \frac{z}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)}\\
t_2 := \frac{\left(x + -2\right) \cdot \left(17.342137594641823 - {t_1}^{2}\right)}{4.16438922228 - t_1}\\
\mathbf{if}\;x \leq -4.791208594581818 \cdot 10^{+40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 1.128817725001906 \cdot 10^{+59}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(\frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + \frac{x \cdot \left(69434.9244037198 - {t_0}^{2}\right)}{263.505074721 - t_0}\right)} + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_0\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}

Error

Target

Original27.0
Target0.8
Herbie1.3
\[\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.79120859458181819e40 or 1.1288177250019061e59 < x

    1. Initial program 61.6

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

      \[\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)}} \]
    3. Taylor expanded in z around 0 57.7

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{\left(\left(137.519416416 + \left(78.6994924154 + 4.16438922228 \cdot x\right) \cdot x\right) \cdot x + y\right) \cdot x}{\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)} \]
    4. Taylor expanded in x around inf 2.1

      \[\leadsto \left(x + -2\right) \cdot \left(\color{blue}{4.16438922228} + \frac{z}{\left(313.399215894 + \left(263.505074721 + x \cdot \left(43.3400022514 + x\right)\right) \cdot x\right) \cdot x + 47.066876606}\right) \]
    5. Applied egg-rr2.2

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

    if -4.79120859458181819e40 < x < 1.1288177250019061e59

    1. Initial program 1.5

      \[\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. Simplified0.6

      \[\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)}} \]
    3. Taylor expanded in z around 0 0.6

      \[\leadsto \left(x + -2\right) \cdot \color{blue}{\left(\frac{\left(\left(137.519416416 + \left(78.6994924154 + 4.16438922228 \cdot x\right) \cdot x\right) \cdot x + y\right) \cdot x}{\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)} \]
    4. Applied egg-rr0.6

      \[\leadsto \left(x + -2\right) \cdot \left(\frac{\left(\left(137.519416416 + \left(78.6994924154 + 4.16438922228 \cdot x\right) \cdot x\right) \cdot x + y\right) \cdot x}{\left(313.399215894 + \color{blue}{\frac{\left(69434.9244037198 - {\left(x \cdot \left(x + 43.3400022514\right)\right)}^{2}\right) \cdot x}{263.505074721 - x \cdot \left(x + 43.3400022514\right)}}\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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.791208594581818 \cdot 10^{+40}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(17.342137594641823 - {\left(\frac{z}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)}\right)}^{2}\right)}{4.16438922228 - \frac{z}{\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{elif}\;x \leq 1.128817725001906 \cdot 10^{+59}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + \frac{x \cdot \left(69434.9244037198 - {\left(x \cdot \left(x + 43.3400022514\right)\right)}^{2}\right)}{263.505074721 - x \cdot \left(x + 43.3400022514\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)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(17.342137594641823 - {\left(\frac{z}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)}\right)}^{2}\right)}{4.16438922228 - \frac{z}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)}}\\ \end{array} \]

Alternatives

Alternative 1
Error1.3
Cost13320
\[\begin{array}{l} t_0 := x \cdot \left(x + 43.3400022514\right)\\ \mathbf{if}\;x \leq -7.609660023409152 \cdot 10^{+41}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot t_0\right)}\right)\\ \mathbf{elif}\;x \leq 1.128817725001906 \cdot 10^{+59}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + \frac{x \cdot \left(69434.9244037198 - {t_0}^{2}\right)}{263.505074721 - t_0}\right)} + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_0\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{x \cdot 4.16438922228}\right)}^{2}\\ \end{array} \]
Alternative 2
Error1.3
Cost10632
\[\begin{array}{l} t_0 := x \cdot \left(x + 43.3400022514\right)\\ \mathbf{if}\;x \leq -7.609660023409152 \cdot 10^{+41}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot t_0\right)}\right)\\ \mathbf{elif}\;x \leq 1.128817725001906 \cdot 10^{+59}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + \frac{x \cdot \left(69434.9244037198 - {t_0}^{2}\right)}{263.505074721 - t_0}\right)} + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_0\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228\\ \end{array} \]
Alternative 3
Error1.6
Cost7240
\[\begin{array}{l} t_0 := x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)\\ t_1 := x \cdot \left(x + 43.3400022514\right)\\ t_2 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_1\right)\right)\\ t_3 := \frac{\left(x + -2\right) \cdot \left(z + t_0\right)}{t_2}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\left(x + -2\right) \cdot \frac{t_0}{t_2}\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+266}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot t_1\right)}\right)\\ \end{array} \]
Alternative 4
Error1.3
Cost3656
\[\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)\\ \mathbf{if}\;x \leq -7.609660023409152 \cdot 10^{+41}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot t_0\right)}\right)\\ \mathbf{elif}\;x \leq 1.128817725001906 \cdot 10^{+59}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\frac{z}{t_1} + \frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{t_1}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228\\ \end{array} \]
Alternative 5
Error3.3
Cost2248
\[\begin{array}{l} t_0 := \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + \left(4.16438922228 + \frac{-101.7851458539211}{x}\right)\right)\\ \mathbf{if}\;x \leq -2.9177376076304425 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.9447035228685531:\\ \;\;\;\;\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 + x \cdot 263.505074721\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error3.3
Cost2248
\[\begin{array}{l} t_0 := \frac{z}{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{-101.7851458539211}{x}\\ \mathbf{if}\;x \leq -2.9177376076304425 \cdot 10^{-5}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(t_0 + \left(\frac{3451.550173699799}{x \cdot x} + t_1\right)\right)\\ \mathbf{elif}\;x \leq 0.9447035228685531:\\ \;\;\;\;\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 + x \cdot 263.505074721\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(t_0 + t_1\right)\\ \end{array} \]
Alternative 7
Error5.4
Cost1992
\[\begin{array}{l} t_0 := x \cdot \left(x + 43.3400022514\right)\\ \mathbf{if}\;x \leq -3.6594936363147846 \cdot 10^{-6}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_0\right)\right)}\right)\\ \mathbf{elif}\;x \leq 1.5584796202387145 \cdot 10^{-5}:\\ \;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + \left(x \cdot 313.399215894 + x \cdot \left(x \cdot t_0 + x \cdot 263.505074721\right)\right)}\right)\\ \end{array} \]
Alternative 8
Error5.3
Cost1992
\[\begin{array}{l} t_0 := \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + \left(4.16438922228 + \frac{-101.7851458539211}{x}\right)\right)\\ \mathbf{if}\;x \leq -3.6594936363147846 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.9447035228685531:\\ \;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error3.4
Cost1992
\[\begin{array}{l} t_0 := x \cdot \left(x + 43.3400022514\right)\\ t_1 := \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + t_0\right)\right)} + \left(4.16438922228 + \frac{-101.7851458539211}{x}\right)\right)\\ \mathbf{if}\;x \leq -2.9177376076304425 \cdot 10^{-5}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 45682558.08320342:\\ \;\;\;\;\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 t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error3.4
Cost1992
\[\begin{array}{l} t_0 := \left(x + -2\right) \cdot \left(\frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + \left(4.16438922228 + \frac{-101.7851458539211}{x}\right)\right)\\ \mathbf{if}\;x \leq -2.9177376076304425 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.9447035228685531:\\ \;\;\;\;\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 313.399215894}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error5.4
Cost1736
\[\begin{array}{l} t_0 := \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{if}\;x \leq -3.6594936363147846 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.5584796202387145 \cdot 10^{-5}:\\ \;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error5.6
Cost1608
\[\begin{array}{l} t_0 := \left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(x \cdot \left(x + 43.3400022514\right)\right)\right)}\right)\\ \mathbf{if}\;x \leq -3.6594936363147846 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.5584796202387145 \cdot 10^{-5}:\\ \;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error7.0
Cost1092
\[\begin{array}{l} \mathbf{if}\;x \leq -7403.217353852133:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \left(\frac{3451.550173699799}{x \cdot x} + \frac{-101.7851458539211}{x}\right)\right)\\ \mathbf{elif}\;x \leq 1.514371972920141:\\ \;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 + -110.1139242984811\\ \end{array} \]
Alternative 14
Error7.0
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq -7403.217353852133:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{-101.7851458539211}{x}\right)\\ \mathbf{elif}\;x \leq 1.514371972920141:\\ \;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 + -110.1139242984811\\ \end{array} \]
Alternative 15
Error7.0
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq -7403.217353852133:\\ \;\;\;\;\left(x \cdot 4.16438922228 + 3655.1204654076414 \cdot \frac{1}{x}\right) + -110.1139242984811\\ \mathbf{elif}\;x \leq 1.514371972920141:\\ \;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 + -110.1139242984811\\ \end{array} \]
Alternative 16
Error16.1
Cost716
\[\begin{array}{l} t_0 := x \cdot 4.16438922228 + -110.1139242984811\\ \mathbf{if}\;x \leq -3.6594936363147846 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -3.8850786612148353 \cdot 10^{-109}:\\ \;\;\;\;x \cdot \left(y \cdot -0.0424927283095952\right)\\ \mathbf{elif}\;x \leq 45682558.08320342:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error15.1
Cost584
\[\begin{array}{l} t_0 := x \cdot 4.16438922228 + -110.1139242984811\\ \mathbf{if}\;x \leq -7403.217353852133:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 45682558.08320342:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error15.2
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -7403.217353852133:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 45682558.08320342:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228\\ \end{array} \]
Alternative 19
Error35.0
Cost192
\[x \cdot 4.16438922228 \]
Alternative 20
Error61.9
Cost64
\[-8.32877844456 \]

Error

Reproduce

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