?

Average Accuracy: 57.9% → 71.1%
Time: 29.2s
Precision: binary64
Cost: 7240

?

\[\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 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\ t_1 := \frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)\right)\right)\right)}{t_0}\\ \mathbf{if}\;t_1 \leq 10^{+263}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t_0}\right)\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+303}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\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
         (+
          47.066876606
          (*
           x
           (+
            313.399215894
            (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
        (t_1
         (/
          (*
           (- x 2.0)
           (+
            z
            (*
             x
             (+
              y
              (*
               x
               (+
                137.519416416
                (* x (+ (* x 4.16438922228) 78.6994924154))))))))
          t_0)))
   (if (<= t_1 1e+263)
     (* (+ x -2.0) (+ 4.16438922228 (/ z t_0)))
     (if (<= t_1 2e+303)
       t_1
       (+
        (* x 4.16438922228)
        (- (/ 3655.1204654076414 x) (/ (- 130977.50649958357 y) (* x x))))))))
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 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (x * ((x * 4.16438922228) + 78.6994924154)))))))) / t_0;
	double tmp;
	if (t_1 <= 1e+263) {
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	} else if (t_1 <= 2e+303) {
		tmp = t_1;
	} else {
		tmp = (x * 4.16438922228) + ((3655.1204654076414 / x) - ((130977.50649958357 - y) / (x * x)));
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = 47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0))))))
    t_1 = ((x - 2.0d0) * (z + (x * (y + (x * (137.519416416d0 + (x * ((x * 4.16438922228d0) + 78.6994924154d0)))))))) / t_0
    if (t_1 <= 1d+263) then
        tmp = (x + (-2.0d0)) * (4.16438922228d0 + (z / t_0))
    else if (t_1 <= 2d+303) then
        tmp = t_1
    else
        tmp = (x * 4.16438922228d0) + ((3655.1204654076414d0 / x) - ((130977.50649958357d0 - y) / (x * x)))
    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 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	double t_1 = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (x * ((x * 4.16438922228) + 78.6994924154)))))))) / t_0;
	double tmp;
	if (t_1 <= 1e+263) {
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	} else if (t_1 <= 2e+303) {
		tmp = t_1;
	} else {
		tmp = (x * 4.16438922228) + ((3655.1204654076414 / x) - ((130977.50649958357 - y) / (x * x)));
	}
	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 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))))
	t_1 = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (x * ((x * 4.16438922228) + 78.6994924154)))))))) / t_0
	tmp = 0
	if t_1 <= 1e+263:
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0))
	elif t_1 <= 2e+303:
		tmp = t_1
	else:
		tmp = (x * 4.16438922228) + ((3655.1204654076414 / x) - ((130977.50649958357 - y) / (x * x)))
	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(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))
	t_1 = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * Float64(137.519416416 + Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)))))))) / t_0)
	tmp = 0.0
	if (t_1 <= 1e+263)
		tmp = Float64(Float64(x + -2.0) * Float64(4.16438922228 + Float64(z / t_0)));
	elseif (t_1 <= 2e+303)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * 4.16438922228) + Float64(Float64(3655.1204654076414 / x) - Float64(Float64(130977.50649958357 - y) / Float64(x * x))));
	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 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
	t_1 = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (x * ((x * 4.16438922228) + 78.6994924154)))))))) / t_0;
	tmp = 0.0;
	if (t_1 <= 1e+263)
		tmp = (x + -2.0) * (4.16438922228 + (z / t_0));
	elseif (t_1 <= 2e+303)
		tmp = t_1;
	else
		tmp = (x * 4.16438922228) + ((3655.1204654076414 / x) - ((130977.50649958357 - y) / (x * x)));
	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[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * N[(137.519416416 + N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+263], N[(N[(x + -2.0), $MachinePrecision] * N[(4.16438922228 + N[(z / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+303], t$95$1, N[(N[(x * 4.16438922228), $MachinePrecision] + N[(N[(3655.1204654076414 / x), $MachinePrecision] - N[(N[(130977.50649958357 - y), $MachinePrecision] / N[(x * x), $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 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := \frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)\right)\right)\right)}{t_0}\\
\mathbf{if}\;t_1 \leq 10^{+263}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(4.16438922228 + \frac{z}{t_0}\right)\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;t_1\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original57.9%
Target98.7%
Herbie71.1%
\[\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 3 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)) < 1.00000000000000002e263

    1. Initial program 94.9%

      \[\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.0%

      \[\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)}} \]
      Step-by-step derivation

      [Start]94.9

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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.0

      \[ \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 z around 0 99.0%

      \[\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 49.9%

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

    if 1.00000000000000002e263 < (/.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)) < 2e303

    1. Initial program 99.4%

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

    if 2e303 < (/.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 0.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. Simplified6.8%

      \[\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)}} \]
      Step-by-step derivation

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

      *-commutative [=>]0.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} \]

      associate-*r/ [<=]6.8

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

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

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

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

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

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

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

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

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

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

      [Start]99.1

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

      associate--l+ [=>]99.1

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

      +-commutative [=>]99.1

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

      associate--r+ [=>]99.1

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

      associate-+l- [=>]99.1

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

      associate-*r/ [=>]99.1

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

      metadata-eval [=>]99.1

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

      div-sub [<=]99.1

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

      unsub-neg [<=]99.1

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

      mul-1-neg [<=]99.1

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

      sub-neg [=>]99.1

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

      +-commutative [=>]99.1

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

      associate-+r- [<=]99.1

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

      unsub-neg [<=]99.1

      \[ \left(-110.1139242984811\right) + \color{blue}{\left(\left(4.16438922228 \cdot x + 3655.1204654076414 \cdot \frac{1}{x}\right) + \left(-\frac{130977.50649958357 + -1 \cdot y}{{x}^{2}}\right)\right)} \]
    5. Taylor expanded in x around inf 99.1%

      \[\leadsto \color{blue}{4.16438922228 \cdot x} + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right) \]
    6. Simplified99.1%

      \[\leadsto \color{blue}{x \cdot 4.16438922228} + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right) \]
      Step-by-step derivation

      [Start]99.1

      \[ 4.16438922228 \cdot x + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right) \]

      *-commutative [=>]99.1

      \[ \color{blue}{x \cdot 4.16438922228} + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\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)} \leq 10^{+263}:\\ \;\;\;\;\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{elif}\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\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)} \leq 2 \cdot 10^{+303}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\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)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy48.4%
Cost46536
\[\begin{array}{l} \mathbf{if}\;x \leq 3.4 \cdot 10^{+56}:\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+61}:\\ \;\;\;\;\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)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \end{array} \]
Alternative 2
Accuracy48.4%
Cost3656
\[\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 5 \cdot 10^{+64}:\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+62}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(\frac{x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right)\right)\right)}{t_0} + \frac{z}{t_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \end{array} \]
Alternative 3
Accuracy48.7%
Cost2505
\[\begin{array}{l} \mathbf{if}\;x \leq 5.8 \cdot 10^{+19} \lor \neg \left(x \leq 2.75 \cdot 10^{+51}\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\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 4
Accuracy48.3%
Cost2377
\[\begin{array}{l} \mathbf{if}\;x \leq 10500000000000 \lor \neg \left(x \leq 10^{+32}\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\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 \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\ \end{array} \]
Alternative 5
Accuracy48.3%
Cost2121
\[\begin{array}{l} \mathbf{if}\;x \leq 2.75 \cdot 10^{+14} \lor \neg \left(x \leq 10^{+32}\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{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 \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\ \end{array} \]
Alternative 6
Accuracy48.5%
Cost1993
\[\begin{array}{l} \mathbf{if}\;x \leq 26000000000 \lor \neg \left(x \leq 1120000\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\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)} + 0.0212463641547976 \cdot \left(x \cdot y\right)\right)\\ \end{array} \]
Alternative 7
Accuracy48.5%
Cost1993
\[\begin{array}{l} \mathbf{if}\;x \leq 57 \lor \neg \left(x \leq 6000\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\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
Accuracy48.6%
Cost1736
\[\begin{array}{l} \mathbf{if}\;x \leq 0.172:\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-6}:\\ \;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - 0.0212463641547976 \cdot \left(z + y \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
Alternative 9
Accuracy48.5%
Cost1353
\[\begin{array}{l} \mathbf{if}\;x \leq 5.5 \lor \neg \left(x \leq 4\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 - x \cdot \left(z \cdot 0.14147091005106402 - y \cdot 0.0212463641547976\right)\right)\\ \end{array} \]
Alternative 10
Accuracy48.5%
Cost1353
\[\begin{array}{l} \mathbf{if}\;x \leq 0.255 \lor \neg \left(x \leq 6000\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952 - x \cdot \left(z \cdot -0.28294182010212804 - 0.0212463641547976 \cdot \left(z + y \cdot -2\right)\right)\\ \end{array} \]
Alternative 11
Accuracy48.9%
Cost1225
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{-24} \lor \neg \left(x \leq 3.6\right):\\ \;\;\;\;x \cdot 4.16438922228 + \left(\frac{3655.1204654076414}{x} - \frac{130977.50649958357 - y}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \end{array} \]
Alternative 12
Accuracy46.8%
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{-24}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right) - 110.1139242984811\\ \end{array} \]
Alternative 13
Accuracy46.9%
Cost840
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{-24}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{elif}\;x \leq 0.155:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\ \end{array} \]
Alternative 14
Accuracy46.8%
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{-24} \lor \neg \left(x \leq 0.66\right):\\ \;\;\;\;\frac{x + -2}{0.24013125253755718}\\ \mathbf{else}:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \end{array} \]
Alternative 15
Accuracy46.5%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{-24}:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 1.95:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;4.16438922228 \cdot \left(x + -2\right)\\ \end{array} \]
Alternative 16
Accuracy46.5%
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{-24}:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 19500000:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228 - 110.1139242984811\\ \end{array} \]
Alternative 17
Accuracy46.5%
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{-24}:\\ \;\;\;\;x \cdot 4.16438922228\\ \mathbf{elif}\;x \leq 2:\\ \;\;\;\;z \cdot -0.0424927283095952\\ \mathbf{else}:\\ \;\;\;\;x \cdot 4.16438922228\\ \end{array} \]
Alternative 18
Accuracy46.1%
Cost192
\[x \cdot 4.16438922228 \]
Alternative 19
Accuracy3.3%
Cost64
\[78.6994924154 \]

Error

Reproduce?

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