?

Average Accuracy: 58.7% → 98.3%
Time: 24.7s
Precision: binary64
Cost: 46537

?

\[\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.4 \cdot 10^{+19} \lor \neg \left(x \leq 2.3 \cdot 10^{+57}\right):\\ \;\;\;\;\mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\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)}\\ \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
 (if (or (<= x -1.4e+19) (not (<= x 2.3e+57)))
   (+
    (fma x 4.16438922228 (/ 3655.1204654076414 x))
    (- -110.1139242984811 (/ (- 130977.50649958357 y) (* x x))))
   (*
    (+ x -2.0)
    (/
     (fma
      x
      (fma x (fma x (fma x 4.16438922228 78.6994924154) 137.519416416) y)
      z)
     (fma
      x
      (fma x (fma x (+ x 43.3400022514) 263.505074721) 313.399215894)
      47.066876606)))))
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.4e+19) || !(x <= 2.3e+57)) {
		tmp = fma(x, 4.16438922228, (3655.1204654076414 / x)) + (-110.1139242984811 - ((130977.50649958357 - y) / (x * x)));
	} else {
		tmp = (x + -2.0) * (fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) / fma(x, fma(x, fma(x, (x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606));
	}
	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.4e+19) || !(x <= 2.3e+57))
		tmp = Float64(fma(x, 4.16438922228, Float64(3655.1204654076414 / x)) + Float64(-110.1139242984811 - Float64(Float64(130977.50649958357 - y) / Float64(x * x))));
	else
		tmp = Float64(Float64(x + -2.0) * Float64(fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) / fma(x, fma(x, fma(x, Float64(x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606)));
	end
	return tmp
end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := If[Or[LessEqual[x, -1.4e+19], N[Not[LessEqual[x, 2.3e+57]], $MachinePrecision]], N[(N[(x * 4.16438922228 + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision] + N[(-110.1139242984811 - N[(N[(130977.50649958357 - y), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(x * N[(x * N[(x * N[(x * 4.16438922228 + 78.6994924154), $MachinePrecision] + 137.519416416), $MachinePrecision] + y), $MachinePrecision] + z), $MachinePrecision] / N[(x * N[(x * N[(x * N[(x + 43.3400022514), $MachinePrecision] + 263.505074721), $MachinePrecision] + 313.399215894), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\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.4 \cdot 10^{+19} \lor \neg \left(x \leq 2.3 \cdot 10^{+57}\right):\\
\;\;\;\;\mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 - y}{x \cdot x}\right)\\

\mathbf{else}:\\
\;\;\;\;\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)}\\


\end{array}

Error?

Target

Original58.7%
Target98.7%
Herbie98.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 < -1.4e19 or 2.2999999999999999e57 < x

    1. Initial program 7.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} \]
    2. Simplified13.0%

      \[\leadsto \color{blue}{\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 + -2}{\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]7.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} \]

      associate-*l/ [<=]13.0

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

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

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

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

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

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

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

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

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

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

      \[ \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} \]
    3. Taylor expanded in x around -inf 97.2%

      \[\leadsto \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) - 110.1139242984811} \]
    4. Simplified97.2%

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

      [Start]97.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e19 < x < 2.2999999999999999e57

    1. Initial program 98.3%

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

      \[\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]98.3

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

      associate-*r/ [<=]99.1

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

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

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

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

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

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

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

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

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

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

      \[ \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. Recombined 2 regimes into one program.
  4. Final simplification98.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+19} \lor \neg \left(x \leq 2.3 \cdot 10^{+57}\right):\\ \;\;\;\;\mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\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)}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy97.9%
Cost7625
\[\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 -6.4 \cdot 10^{+19} \lor \neg \left(x \leq 2.9 \cdot 10^{+55}\right):\\ \;\;\;\;\mathsf{fma}\left(x, 4.16438922228, \frac{3655.1204654076414}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x \cdot \left(x + -2\right)\right) \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{t_0} + \frac{\left(x + -2\right) \cdot z}{t_0}\\ \end{array} \]
Alternative 2
Accuracy97.2%
Cost3913
\[\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.65 \cdot 10^{+60} \lor \neg \left(x \leq 1.78 \cdot 10^{+53}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x \cdot \left(x + -2\right)\right) \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(78.6994924154 + x \cdot 4.16438922228\right)\right)\right)}{t_0} + \frac{\left(x + -2\right) \cdot z}{t_0}\\ \end{array} \]
Alternative 3
Accuracy97.0%
Cost2761
\[\begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{+61} \lor \neg \left(x \leq 3 \cdot 10^{+42}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \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)}{47.066876606 + x \cdot \left(313.399215894 + \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right)\right) + x \cdot 263.505074721\right)\right)}\\ \end{array} \]
Alternative 4
Accuracy97.0%
Cost2633
\[\begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{+60} \lor \neg \left(x \leq 3 \cdot 10^{+42}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \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)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\ \end{array} \]
Alternative 5
Accuracy95.7%
Cost2505
\[\begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+60} \lor \neg \left(x \leq 3 \cdot 10^{+42}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \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)}{47.066876606 + x \cdot \left(313.399215894 + \left(x \cdot x\right) \cdot \left(x + 43.3400022514\right)\right)}\\ \end{array} \]
Alternative 6
Accuracy92.1%
Cost2124
\[\begin{array}{l} \mathbf{if}\;x \leq -37:\\ \;\;\;\;\frac{x + -2}{\frac{5.86923874282773}{x} + \left(0.24013125253755718 + \frac{-55.572073733743466}{x \cdot x}\right)}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-29}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+33}:\\ \;\;\;\;x \cdot 4.16438922228 + \frac{\left(x + -2\right) \cdot z}{47.066876606 + x \cdot \left(313.399215894 + \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right)\right) + x \cdot 263.505074721\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \end{array} \]
Alternative 7
Accuracy94.2%
Cost2121
\[\begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+28} \lor \neg \left(x \leq 8.6 \cdot 10^{+33}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \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 \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\ \end{array} \]
Alternative 8
Accuracy92.1%
Cost1996
\[\begin{array}{l} \mathbf{if}\;x \leq -1.35:\\ \;\;\;\;\frac{x + -2}{\frac{5.86923874282773}{x} + \left(0.24013125253755718 + \frac{-55.572073733743466}{x \cdot x}\right)}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-29}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot 313.399215894}\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{+33}:\\ \;\;\;\;\frac{\left(x + -2\right) \cdot z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} + x \cdot 4.16438922228\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \end{array} \]
Alternative 9
Accuracy93.2%
Cost1993
\[\begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{+30} \lor \neg \left(x \leq 2.05 \cdot 10^{+33}\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \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 + \left(x \cdot x\right) \cdot \left(x + 43.3400022514\right)\right)}\\ \end{array} \]
Alternative 10
Accuracy92.6%
Cost1481
\[\begin{array}{l} \mathbf{if}\;x \leq -37 \lor \neg \left(x \leq 36000\right):\\ \;\;\;\;\frac{x + -2}{\frac{5.86923874282773}{x} + \left(0.24013125253755718 + \frac{-55.572073733743466}{x \cdot x}\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 313.399215894}\\ \end{array} \]
Alternative 11
Accuracy89.4%
Cost1352
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 8:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 + x \cdot \left(y \cdot 0.0212463641547976 + z \cdot -0.14147091005106402\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{\frac{5.86923874282773}{x} + \left(0.24013125253755718 + \frac{-55.572073733743466}{x \cdot x}\right)}\\ \end{array} \]
Alternative 12
Accuracy89.4%
Cost1352
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 1820:\\ \;\;\;\;x \cdot \left(0.0212463641547976 \cdot \left(z + y \cdot -2\right) + z \cdot 0.28294182010212804\right) + z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{\frac{5.86923874282773}{x} + \left(0.24013125253755718 + \frac{-55.572073733743466}{x \cdot x}\right)}\\ \end{array} \]
Alternative 13
Accuracy76.8%
Cost1224
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 1820:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot \left(0.0212463641547976 + x \cdot \left(-0.14147091005106402 + x \cdot 0.8230490379027244\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\ \end{array} \]
Alternative 14
Accuracy76.8%
Cost1224
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 1820:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot \left(0.0212463641547976 + x \cdot \left(-0.14147091005106402 + x \cdot 0.8230490379027244\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{\frac{5.86923874282773}{x} + \left(0.24013125253755718 + \frac{-55.572073733743466}{x \cdot x}\right)}\\ \end{array} \]
Alternative 15
Accuracy76.5%
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 1820:\\ \;\;\;\;\frac{x + -2}{\frac{47.066876606}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} + -110.1139242984811\right)\\ \end{array} \]
Alternative 16
Accuracy76.6%
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 1820:\\ \;\;\;\;\frac{x + -2}{\frac{47.066876606}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\ \end{array} \]
Alternative 17
Accuracy76.5%
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19} \lor \neg \left(x \leq 1820\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976\right)\\ \end{array} \]
Alternative 18
Accuracy76.5%
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19} \lor \neg \left(x \leq 2200\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{\frac{47.066876606}{z}}\\ \end{array} \]
Alternative 19
Accuracy76.5%
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19} \lor \neg \left(x \leq 1.1\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \end{array} \]
Alternative 20
Accuracy76.3%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 13.5:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;-110.1139242984811 + x \cdot 4.16438922228\\ \end{array} \]
Alternative 21
Accuracy76.2%
Cost457
\[\begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+19} \lor \neg \left(x \leq 2\right):\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \end{array} \]
Alternative 22
Accuracy2.2%
Cost192
\[x \cdot -0.3407596943375357 \]
Alternative 23
Accuracy44.1%
Cost192
\[x \cdot 4.16438922228 \]

Error

Reproduce?

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