Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D

?

Percentage Accurate: 58.6% → 97.1%
Time: 27.2s
Precision: binary64
Cost: 48580

?

\[x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+
  x
  (/
   (*
    y
    (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b))
   (+
    (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z)
    0.607771387771))))
(FPCore (x y z t a b)
 :precision binary64
 (if (<=
      (/
       (*
        y
        (+
         (* z (+ (* z (+ (* z (+ 11.1667541262 (* z 3.13060547623))) t)) a))
         b))
       (+
        (*
         z
         (+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
        0.607771387771))
      INFINITY)
   (+
    x
    (/
     y
     (/
      (fma
       (fma (fma (+ z 15.234687407) z 31.4690115749) z 11.9400905721)
       z
       0.607771387771)
      (fma (fma (fma (fma z 3.13060547623 11.1667541262) z t) z a) z b))))
   (+ x (/ y 0.31942702700572795))))
double code(double x, double y, double z, double t, double a, double b) {
	return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((y * ((z * ((z * ((z * (11.1667541262 + (z * 3.13060547623))) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= ((double) INFINITY)) {
		tmp = x + (y / (fma(fma(fma((z + 15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771) / fma(fma(fma(fma(z, 3.13060547623, 11.1667541262), z, t), z, a), z, b)));
	} else {
		tmp = x + (y / 0.31942702700572795);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)))
end
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(11.1667541262 + Float64(z * 3.13060547623))) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= Inf)
		tmp = Float64(x + Float64(y / Float64(fma(fma(fma(Float64(z + 15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771) / fma(fma(fma(fma(z, 3.13060547623, 11.1667541262), z, t), z, a), z, b))));
	else
		tmp = Float64(x + Float64(y / 0.31942702700572795));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(y * N[(N[(N[(N[(N[(N[(N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(11.1667541262 + N[(z * 3.13060547623), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(y / N[(N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z + 31.4690115749), $MachinePrecision] * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision] / N[(N[(N[(N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] * z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / 0.31942702700572795), $MachinePrecision]), $MachinePrecision]]
x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\
\;\;\;\;x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{0.31942702700572795}\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 15 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Target

Original58.6%
Target98.5%
Herbie97.1%
\[\begin{array}{l} \mathbf{if}\;z < -6.499344996252632 \cdot 10^{+53}:\\ \;\;\;\;x + \left(\left(3.13060547623 - \frac{36.527041698806414}{z}\right) + \frac{t}{z \cdot z}\right) \cdot \frac{y}{1}\\ \mathbf{elif}\;z < 7.066965436914287 \cdot 10^{+59}:\\ \;\;\;\;x + \frac{y}{\frac{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(3.13060547623 - \frac{36.527041698806414}{z}\right) + \frac{t}{z \cdot z}\right) \cdot \frac{y}{1}\\ \end{array} \]

Derivation?

  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z 15234687407/1000000000) z) 314690115749/10000000000) z) 119400905721/10000000000) z) 607771387771/1000000000000)) < +inf.0

    1. Initial program 90.6%

      \[x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \]
    2. Simplified95.4%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}} \]
      Step-by-step derivation

      [Start]90.6%

      \[ x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \]

      associate-/l* [=>]95.4%

      \[ x + \color{blue}{\frac{y}{\frac{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}}} \]

      fma-def [=>]95.4%

      \[ x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721, z, 0.607771387771\right)}}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}} \]

      fma-def [=>]95.4%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749, z, 11.9400905721\right)}, z, 0.607771387771\right)}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}} \]

      fma-def [=>]95.4%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right)}, z, 11.9400905721\right), z, 0.607771387771\right)}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}} \]

      fma-def [=>]95.4%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a, z, b\right)}}} \]

      fma-def [=>]95.4%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t, z, a\right)}, z, b\right)}} \]

      fma-def [=>]95.4%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z \cdot 3.13060547623 + 11.1667541262, z, t\right)}, z, a\right), z, b\right)}} \]

      fma-def [=>]95.4%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right)}, z, t\right), z, a\right), z, b\right)}} \]

    if +inf.0 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z 15234687407/1000000000) z) 314690115749/10000000000) z) 119400905721/10000000000) z) 607771387771/1000000000000))

    1. Initial program 0.0%

      \[x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}} \]
      Step-by-step derivation

      [Start]0.0%

      \[ x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \]

      associate-/l* [=>]0.0%

      \[ x + \color{blue}{\frac{y}{\frac{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}}} \]

      fma-def [=>]0.0%

      \[ x + \frac{y}{\frac{\color{blue}{\mathsf{fma}\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721, z, 0.607771387771\right)}}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}} \]

      fma-def [=>]0.0%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749, z, 11.9400905721\right)}, z, 0.607771387771\right)}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}} \]

      fma-def [=>]0.0%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right)}, z, 11.9400905721\right), z, 0.607771387771\right)}{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}} \]

      fma-def [=>]0.0%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a, z, b\right)}}} \]

      fma-def [=>]0.0%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t, z, a\right)}, z, b\right)}} \]

      fma-def [=>]0.0%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z \cdot 3.13060547623 + 11.1667541262, z, t\right)}, z, a\right), z, b\right)}} \]

      fma-def [=>]0.0%

      \[ x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right)}, z, t\right), z, a\right), z, b\right)}} \]
    3. Taylor expanded in z around inf 97.1%

      \[\leadsto x + \frac{y}{\color{blue}{0.31942702700572795}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy97.1%
Cost48580
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;x + \frac{y}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \end{array} \]
Alternative 2
Accuracy96.6%
Cost29764
\[\begin{array}{l} t_1 := z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771\\ \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) + a\right) + b\right)}{t_1} \leq \infty:\\ \;\;\;\;x + \frac{y}{t_1} \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right), b\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \end{array} \]
Alternative 3
Accuracy93.4%
Cost10884
\[\begin{array}{l} t_1 := 11.1667541262 + z \cdot 3.13060547623\\ t_2 := z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771\\ \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot t_1 + t\right) + a\right) + b\right)}{t_2} \leq \infty:\\ \;\;\;\;x + \frac{y}{\frac{t_2}{b + z \cdot \left(a + t_1 \cdot {z}^{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \end{array} \]
Alternative 4
Accuracy95.6%
Cost3913
\[\begin{array}{l} t_1 := z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771\\ \mathbf{if}\;z \leq -3.8 \cdot 10^{+45} \lor \neg \left(z \leq 2.3 \cdot 10^{+63}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{b + \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) \cdot \left(z \cdot z\right)}{\frac{t_1}{y}} + \frac{y \cdot \left(z \cdot a\right)}{t_1}\right)\\ \end{array} \]
Alternative 5
Accuracy95.8%
Cost2633
\[\begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+37} \lor \neg \left(z \leq 1.38 \cdot 10^{+63}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} + x\\ \end{array} \]
Alternative 6
Accuracy95.1%
Cost2377
\[\begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+34} \lor \neg \left(z \leq 1.38 \cdot 10^{+63}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot \left(a + z \cdot \left(t + z \cdot 11.1667541262\right)\right)\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}\\ \end{array} \]
Alternative 7
Accuracy90.5%
Cost1996
\[\begin{array}{l} t_1 := x + \frac{y}{0.31942702700572795}\\ \mathbf{if}\;z \leq -500000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-7}:\\ \;\;\;\;x + \frac{y}{\frac{0.607771387771 + z \cdot 11.9400905721}{b + z \cdot \left(a + z \cdot \left(z \cdot 11.1667541262\right)\right)}}\\ \mathbf{elif}\;z \leq 10^{+46}:\\ \;\;\;\;x + \frac{\left(z \cdot z\right) \cdot \left(y \cdot t\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Accuracy93.0%
Cost1993
\[\begin{array}{l} \mathbf{if}\;z \leq -500000000000 \lor \neg \left(z \leq 5.5 \cdot 10^{+43}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right) + t\right) + a\right) + b\right)}{0.607771387771 + z \cdot 11.9400905721}\\ \end{array} \]
Alternative 9
Accuracy90.2%
Cost1609
\[\begin{array}{l} \mathbf{if}\;z \leq -530000000000 \lor \neg \left(z \leq 5.5 \cdot 10^{-7}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{0.607771387771 + z \cdot 11.9400905721}{b + z \cdot \left(a + z \cdot \left(z \cdot 11.1667541262\right)\right)}}\\ \end{array} \]
Alternative 10
Accuracy89.9%
Cost1225
\[\begin{array}{l} \mathbf{if}\;z \leq -500000000000 \lor \neg \left(z \leq 5.5 \cdot 10^{-7}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot a\right)}{0.607771387771 + z \cdot 11.9400905721}\\ \end{array} \]
Alternative 11
Accuracy83.6%
Cost1096
\[\begin{array}{l} t_1 := x + \frac{y}{0.31942702700572795}\\ \mathbf{if}\;z \leq -500000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-43}:\\ \;\;\;\;x + \frac{a \cdot \left(y \cdot z\right)}{0.607771387771 + z \cdot 11.9400905721}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-12}:\\ \;\;\;\;x + 1.6453555072203998 \cdot \left(y \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Accuracy83.5%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-14} \lor \neg \left(z \leq 1.05 \cdot 10^{-12}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;x + 1.6453555072203998 \cdot \left(y \cdot b\right)\\ \end{array} \]
Alternative 13
Accuracy83.4%
Cost712
\[\begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{-18}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795 + \frac{3.7269864963038164}{z}}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-12}:\\ \;\;\;\;x + 1.6453555072203998 \cdot \left(y \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \end{array} \]
Alternative 14
Accuracy64.9%
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{-16} \lor \neg \left(z \leq 3.12 \cdot 10^{-22}\right):\\ \;\;\;\;x + \frac{y}{0.31942702700572795}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 15
Accuracy45.7%
Cost64
\[x \]

Reproduce?

herbie shell --seed 2023272 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D"
  :precision binary64

  :herbie-target
  (if (< z -6.499344996252632e+53) (+ x (* (+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (* z z))) (/ y 1.0))) (if (< z 7.066965436914287e+59) (+ x (/ y (/ (+ (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z) 0.607771387771) (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b)))) (+ x (* (+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (* z z))) (/ y 1.0)))))

  (+ x (/ (* y (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b)) (+ (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z) 0.607771387771))))