?

Average Error: 26.9 → 1.2
Time: 41.9s
Precision: binary64
Cost: 10052

?

\[\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 4.16438922228 + 78.6994924154\\ \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(t_0 \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} \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\left(x - 2\right) \cdot \frac{x \cdot \left(x \cdot \left(x \cdot t_0 + 137.519416416\right) + y\right) + z}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 4.16438922228 + 3655.1204654076414 \cdot \frac{1}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 + \left(-y\right)}{{x}^{2}}\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 (+ (* x 4.16438922228) 78.6994924154)))
   (if (<=
        (/
         (* (- x 2.0) (+ (* (+ (* (+ (* t_0 x) 137.519416416) x) y) x) z))
         (+
          (*
           (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894)
           x)
          47.066876606))
        5e+293)
     (*
      (- x 2.0)
      (/
       (+ (* x (+ (* x (+ (* x t_0) 137.519416416)) y)) z)
       (+
        (*
         x
         (+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
        47.066876606)))
     (+
      (+ (* x 4.16438922228) (* 3655.1204654076414 (/ 1.0 x)))
      (- -110.1139242984811 (/ (+ 130977.50649958357 (- y)) (pow x 2.0)))))))
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 * 4.16438922228) + 78.6994924154;
	double tmp;
	if ((((x - 2.0) * ((((((t_0 * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 5e+293) {
		tmp = (x - 2.0) * (((x * ((x * ((x * t_0) + 137.519416416)) + y)) + z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606));
	} else {
		tmp = ((x * 4.16438922228) + (3655.1204654076414 * (1.0 / x))) + (-110.1139242984811 - ((130977.50649958357 + -y) / pow(x, 2.0)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x * 4.16438922228d0) + 78.6994924154d0
    if ((((x - 2.0d0) * ((((((t_0 * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)) <= 5d+293) then
        tmp = (x - 2.0d0) * (((x * ((x * ((x * t_0) + 137.519416416d0)) + y)) + z) / ((x * ((x * ((x * (x + 43.3400022514d0)) + 263.505074721d0)) + 313.399215894d0)) + 47.066876606d0))
    else
        tmp = ((x * 4.16438922228d0) + (3655.1204654076414d0 * (1.0d0 / x))) + ((-110.1139242984811d0) - ((130977.50649958357d0 + -y) / (x ** 2.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
public static double code(double x, double y, double z) {
	double t_0 = (x * 4.16438922228) + 78.6994924154;
	double tmp;
	if ((((x - 2.0) * ((((((t_0 * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 5e+293) {
		tmp = (x - 2.0) * (((x * ((x * ((x * t_0) + 137.519416416)) + y)) + z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606));
	} else {
		tmp = ((x * 4.16438922228) + (3655.1204654076414 * (1.0 / x))) + (-110.1139242984811 - ((130977.50649958357 + -y) / Math.pow(x, 2.0)));
	}
	return tmp;
}
def code(x, y, z):
	return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
def code(x, y, z):
	t_0 = (x * 4.16438922228) + 78.6994924154
	tmp = 0
	if (((x - 2.0) * ((((((t_0 * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 5e+293:
		tmp = (x - 2.0) * (((x * ((x * ((x * t_0) + 137.519416416)) + y)) + z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606))
	else:
		tmp = ((x * 4.16438922228) + (3655.1204654076414 * (1.0 / x))) + (-110.1139242984811 - ((130977.50649958357 + -y) / math.pow(x, 2.0)))
	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(Float64(x * 4.16438922228) + 78.6994924154)
	tmp = 0.0
	if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(t_0 * 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)) <= 5e+293)
		tmp = Float64(Float64(x - 2.0) * Float64(Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * t_0) + 137.519416416)) + y)) + z) / Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)));
	else
		tmp = Float64(Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 * Float64(1.0 / x))) + Float64(-110.1139242984811 - Float64(Float64(130977.50649958357 + Float64(-y)) / (x ^ 2.0))));
	end
	return tmp
end
function tmp = code(x, y, z)
	tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
end
function tmp_2 = code(x, y, z)
	t_0 = (x * 4.16438922228) + 78.6994924154;
	tmp = 0.0;
	if ((((x - 2.0) * ((((((t_0 * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) <= 5e+293)
		tmp = (x - 2.0) * (((x * ((x * ((x * t_0) + 137.519416416)) + y)) + z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606));
	else
		tmp = ((x * 4.16438922228) + (3655.1204654076414 * (1.0 / x))) + (-110.1139242984811 - ((130977.50649958357 + -y) / (x ^ 2.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(t$95$0 * 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], 5e+293], N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(x * N[(N[(x * N[(N[(x * t$95$0), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] / N[(N[(x * N[(N[(x * N[(N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision] + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-110.1139242984811 - N[(N[(130977.50649958357 + (-y)), $MachinePrecision] / N[Power[x, 2.0], $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 := x \cdot 4.16438922228 + 78.6994924154\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(\left(\left(t_0 \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} \leq 5 \cdot 10^{+293}:\\
\;\;\;\;\left(x - 2\right) \cdot \frac{x \cdot \left(x \cdot \left(x \cdot t_0 + 137.519416416\right) + y\right) + z}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 4.16438922228 + 3655.1204654076414 \cdot \frac{1}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 + \left(-y\right)}{{x}^{2}}\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original26.9
Target0.8
Herbie1.2
\[\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 (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) < 5.00000000000000033e293

    1. Initial program 2.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. Simplified0.7

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

      [Start]2.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} \]

      rational.json-simplify-2 [=>]2.3

      \[ \frac{\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 \left(x - 2\right)}}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606} \]

      rational.json-simplify-49 [=>]0.7

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

      rational.json-simplify-2 [=>]0.7

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

      rational.json-simplify-2 [=>]0.7

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

      rational.json-simplify-2 [=>]0.7

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

    if 5.00000000000000033e293 < (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000))

    1. Initial program 63.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. Taylor expanded in x around -inf 1.9

      \[\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} \]
    3. Simplified1.9

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

      [Start]1.9

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

      rational.json-simplify-48 [=>]1.9

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

      rational.json-simplify-2 [<=]1.9

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

      rational.json-simplify-2 [=>]1.9

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

      rational.json-simplify-9 [=>]1.9

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

      rational.json-simplify-12 [=>]1.9

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

      rational.json-simplify-42 [=>]1.9

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

      metadata-eval [=>]1.9

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

      rational.json-simplify-2 [=>]1.9

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

      rational.json-simplify-9 [=>]1.9

      \[ \left(x \cdot 4.16438922228 + 3655.1204654076414 \cdot \frac{1}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 + \color{blue}{\left(-y\right)}}{{x}^{2}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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} \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\left(x - 2\right) \cdot \frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 4.16438922228 + 3655.1204654076414 \cdot \frac{1}{x}\right) + \left(-110.1139242984811 - \frac{130977.50649958357 + \left(-y\right)}{{x}^{2}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error1.5
Cost2632
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718}\\ \mathbf{if}\;x \leq -8.9 \cdot 10^{+46}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{+46}:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right) \cdot \frac{x - 2}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error1.4
Cost2632
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718}\\ \mathbf{if}\;x \leq -8.9 \cdot 10^{+46}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{+46}:\\ \;\;\;\;\left(x - 2\right) \cdot \frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error3.3
Cost2248
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718}\\ \mathbf{if}\;x \leq -1.55 \cdot 10^{+42}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{+28}:\\ \;\;\;\;\frac{2 - x}{\frac{-1}{\frac{x \cdot \left(x \cdot 137.519416416 + y\right) + z}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error3.6
Cost2120
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718}\\ \mathbf{if}\;x \leq -2.6 \cdot 10^{+36}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+16}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + 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 5
Error4.8
Cost1868
\[\begin{array}{l} \mathbf{if}\;x \leq -3.85 \cdot 10^{+39}:\\ \;\;\;\;\frac{x - 2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-5}:\\ \;\;\;\;\frac{z}{\frac{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}{x - 2}}\\ \mathbf{elif}\;x \leq 1700:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{\left(x \cdot 263.505074721 + 313.399215894\right) \cdot x + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \end{array} \]
Alternative 6
Error4.9
Cost1612
\[\begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+37}:\\ \;\;\;\;\frac{x - 2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-5}:\\ \;\;\;\;z \cdot \frac{x - 2}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\ \mathbf{elif}\;x \leq 260:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{x \cdot 313.399215894 + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \end{array} \]
Alternative 7
Error4.9
Cost1612
\[\begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+37}:\\ \;\;\;\;\frac{x - 2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{z}{\frac{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}{x - 2}}\\ \mathbf{elif}\;x \leq 18000:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{x \cdot 313.399215894 + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \end{array} \]
Alternative 8
Error5.1
Cost1480
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \mathbf{if}\;x \leq -0.175:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;\left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right) \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error4.7
Cost1480
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \mathbf{if}\;x \leq -36:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 118:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(\left(x \cdot 137.519416416 + y\right) \cdot x + z\right)}{x \cdot 313.399215894 + 47.066876606}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error6.4
Cost1352
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \mathbf{if}\;x \leq -0.175:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.38:\\ \;\;\;\;\left(x - 2\right) \cdot \left(0.0212463641547976 \cdot z + \left(0.0212463641547976 \cdot y - z \cdot 0.14147091005106402\right) \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error6.6
Cost1096
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \mathbf{if}\;x \leq -0.175:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 450:\\ \;\;\;\;\left(x - 2\right) \cdot \left(0.0212463641547976 \cdot z + x \cdot \left(0.0212463641547976 \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error14.3
Cost968
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718}\\ \mathbf{if}\;x \leq -36:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2100:\\ \;\;\;\;z \cdot \frac{x - 2}{47.066876606 + x \cdot 313.399215894}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error14.3
Cost968
\[\begin{array}{l} \mathbf{if}\;x \leq -36:\\ \;\;\;\;\left(x \cdot 4.16438922228 + 3655.1204654076414 \cdot \frac{1}{x}\right) - 110.1139242984811\\ \mathbf{elif}\;x \leq 11.5:\\ \;\;\;\;z \cdot \frac{x - 2}{47.066876606 + x \cdot 313.399215894}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - 2}{0.24013125253755718}\\ \end{array} \]
Alternative 14
Error14.2
Cost968
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718 + 5.86923874282773 \cdot \frac{1}{x}}\\ \mathbf{if}\;x \leq -36:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 18:\\ \;\;\;\;z \cdot \frac{x - 2}{47.066876606 + x \cdot 313.399215894}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 15
Error14.3
Cost712
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718}\\ \mathbf{if}\;x \leq -150:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.135:\\ \;\;\;\;z \cdot \left(x \cdot 0.3041881842569256 - 0.0424927283095952\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 16
Error14.6
Cost584
\[\begin{array}{l} t_0 := \left(x - 2\right) \cdot 4.16438922228\\ \mathbf{if}\;x \leq -82:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 0.92:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error14.5
Cost584
\[\begin{array}{l} t_0 := x \cdot 4.16438922228 - 110.1139242984811\\ \mathbf{if}\;x \leq -0.24:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 7.8:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error14.5
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -0.118:\\ \;\;\;\;\frac{1}{\frac{0.24013125253755718}{x}}\\ \mathbf{elif}\;x \leq 2.2:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 - 110.1139242984811\\ \end{array} \]
Alternative 19
Error14.4
Cost584
\[\begin{array}{l} t_0 := \frac{x - 2}{0.24013125253755718}\\ \mathbf{if}\;x \leq -0.22:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.9:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 20
Error37.8
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+37}:\\ \;\;\;\;x \cdot 0.5218852675289308\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.5218852675289308\\ \end{array} \]
Alternative 21
Error14.6
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -780:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;-0.0424927283095952 \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228\\ \end{array} \]
Alternative 22
Error41.4
Cost192
\[-0.0424927283095952 \cdot z \]

Error

Reproduce?

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