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

?

Percentage Accurate: 58.8% → 98.3%
Time: 14.7s
Precision: binary64
Cost: 46537

?

\[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}\;z \leq -4.8 \cdot 10^{+52} \lor \neg \left(z \leq 4 \cdot 10^{+40}\right):\\ \;\;\;\;x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \mathsf{fma}\left(98.5170599679272, \frac{y}{z \cdot z}, \frac{\left(y \cdot 36.52704169880642\right) \cdot -15.234687407}{z \cdot z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;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)}}\\ \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 (or (<= z -4.8e+52) (not (<= z 4e+40)))
   (+
    x
    (-
     (-
      (fma y 3.13060547623 (/ y (/ (* z z) t)))
      (/ (* y 36.52704169880642) z))
     (fma
      98.5170599679272
      (/ y (* z z))
      (/ (* (* y 36.52704169880642) -15.234687407) (* z z)))))
   (+
    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))))))
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 ((z <= -4.8e+52) || !(z <= 4e+40)) {
		tmp = x + ((fma(y, 3.13060547623, (y / ((z * z) / t))) - ((y * 36.52704169880642) / z)) - fma(98.5170599679272, (y / (z * z)), (((y * 36.52704169880642) * -15.234687407) / (z * z))));
	} else {
		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)));
	}
	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 ((z <= -4.8e+52) || !(z <= 4e+40))
		tmp = Float64(x + Float64(Float64(fma(y, 3.13060547623, Float64(y / Float64(Float64(z * z) / t))) - Float64(Float64(y * 36.52704169880642) / z)) - fma(98.5170599679272, Float64(y / Float64(z * z)), Float64(Float64(Float64(y * 36.52704169880642) * -15.234687407) / Float64(z * z)))));
	else
		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))));
	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[Or[LessEqual[z, -4.8e+52], N[Not[LessEqual[z, 4e+40]], $MachinePrecision]], N[(x + N[(N[(N[(y * 3.13060547623 + N[(y / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * 36.52704169880642), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(98.5170599679272 * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * 36.52704169880642), $MachinePrecision] * -15.234687407), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
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}\;z \leq -4.8 \cdot 10^{+52} \lor \neg \left(z \leq 4 \cdot 10^{+40}\right):\\
\;\;\;\;x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \mathsf{fma}\left(98.5170599679272, \frac{y}{z \cdot z}, \frac{\left(y \cdot 36.52704169880642\right) \cdot -15.234687407}{z \cdot z}\right)\right)\\

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


\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 13 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.8%
Target98.5%
Herbie98.3%
\[\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 z < -4.8e52 or 4.00000000000000012e40 < z

    1. Initial program 1.4%

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

      \[\leadsto \color{blue}{x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z + 15.234687407, 31.4690115749\right), 11.9400905721\right), 0.607771387771\right)} \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)} \]
      Step-by-step derivation

      [Start]1.4%

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

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

      *-commutative [=>]4.8%

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

      fma-def [=>]4.8%

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

      *-commutative [=>]4.8%

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

      fma-def [=>]4.8%

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

      *-commutative [=>]4.8%

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

      fma-def [=>]4.8%

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

      *-commutative [=>]4.8%

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

      fma-def [=>]4.8%

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

      \[\leadsto x + \color{blue}{\left(\left(-1 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z} + \left(\frac{y \cdot t}{{z}^{2}} + 3.13060547623 \cdot y\right)\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right)} \]
    4. Simplified99.4%

      \[\leadsto x + \color{blue}{\left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \mathsf{fma}\left(98.5170599679272, \frac{y}{z \cdot z}, \frac{\left(y \cdot 36.52704169880642\right) \cdot -15.234687407}{z \cdot z}\right)\right)} \]
      Step-by-step derivation

      [Start]94.0%

      \[ x + \left(\left(-1 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z} + \left(\frac{y \cdot t}{{z}^{2}} + 3.13060547623 \cdot y\right)\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      +-commutative [=>]94.0%

      \[ x + \left(\color{blue}{\left(\left(\frac{y \cdot t}{{z}^{2}} + 3.13060547623 \cdot y\right) + -1 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right)} - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      mul-1-neg [=>]94.0%

      \[ x + \left(\left(\left(\frac{y \cdot t}{{z}^{2}} + 3.13060547623 \cdot y\right) + \color{blue}{\left(-\frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right)}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      unsub-neg [=>]94.0%

      \[ x + \left(\color{blue}{\left(\left(\frac{y \cdot t}{{z}^{2}} + 3.13060547623 \cdot y\right) - \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right)} - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      +-commutative [=>]94.0%

      \[ x + \left(\left(\color{blue}{\left(3.13060547623 \cdot y + \frac{y \cdot t}{{z}^{2}}\right)} - \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      *-commutative [=>]94.0%

      \[ x + \left(\left(\left(\color{blue}{y \cdot 3.13060547623} + \frac{y \cdot t}{{z}^{2}}\right) - \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      fma-def [=>]94.0%

      \[ x + \left(\left(\color{blue}{\mathsf{fma}\left(y, 3.13060547623, \frac{y \cdot t}{{z}^{2}}\right)} - \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      associate-/l* [=>]99.4%

      \[ x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \color{blue}{\frac{y}{\frac{{z}^{2}}{t}}}\right) - \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      unpow2 [=>]99.4%

      \[ x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{\color{blue}{z \cdot z}}{t}}\right) - \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{z}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      distribute-rgt-out-- [=>]99.4%

      \[ x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{\color{blue}{y \cdot \left(-11.1667541262 - -47.69379582500642\right)}}{z}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      metadata-eval [=>]99.4%

      \[ x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot \color{blue}{36.52704169880642}}{z}\right) - \left(-15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}} + 98.5170599679272 \cdot \frac{y}{{z}^{2}}\right)\right) \]

      +-commutative [=>]99.4%

      \[ x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \color{blue}{\left(98.5170599679272 \cdot \frac{y}{{z}^{2}} + -15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}}\right)}\right) \]

      fma-def [=>]99.4%

      \[ x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \color{blue}{\mathsf{fma}\left(98.5170599679272, \frac{y}{{z}^{2}}, -15.234687407 \cdot \frac{-11.1667541262 \cdot y - -47.69379582500642 \cdot y}{{z}^{2}}\right)}\right) \]

    if -4.8e52 < z < 4.00000000000000012e40

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+52} \lor \neg \left(z \leq 4 \cdot 10^{+40}\right):\\ \;\;\;\;x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \mathsf{fma}\left(98.5170599679272, \frac{y}{z \cdot z}, \frac{\left(y \cdot 36.52704169880642\right) \cdot -15.234687407}{z \cdot z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;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)}}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy98.3%
Cost46537
\[\begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+52} \lor \neg \left(z \leq 4 \cdot 10^{+40}\right):\\ \;\;\;\;x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \mathsf{fma}\left(98.5170599679272, \frac{y}{z \cdot z}, \frac{\left(y \cdot 36.52704169880642\right) \cdot -15.234687407}{z \cdot z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;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)}}\\ \end{array} \]
Alternative 2
Accuracy97.8%
Cost27721
\[\begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+18} \lor \neg \left(z \leq 3 \cdot 10^{+49}\right):\\ \;\;\;\;x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \mathsf{fma}\left(98.5170599679272, \frac{y}{z \cdot z}, \frac{\left(y \cdot 36.52704169880642\right) \cdot -15.234687407}{z \cdot z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.607771387771 + z \cdot \left(11.9400905721 + z \cdot \left(31.4690115749 + z \cdot \left(z + 15.234687407\right)\right)\right)} \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)\\ \end{array} \]
Alternative 3
Accuracy97.4%
Cost15177
\[\begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+43} \lor \neg \left(z \leq 4.9 \cdot 10^{+14}\right):\\ \;\;\;\;x + \left(\left(\mathsf{fma}\left(y, 3.13060547623, \frac{y}{\frac{z \cdot z}{t}}\right) - \frac{y \cdot 36.52704169880642}{z}\right) - \mathsf{fma}\left(98.5170599679272, \frac{y}{z \cdot z}, \frac{\left(y \cdot 36.52704169880642\right) \cdot -15.234687407}{z \cdot z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot \left(a + z \cdot \left(t + z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right)\right)\right)\right)}{0.607771387771 + z \cdot \left(11.9400905721 + z \cdot \left(31.4690115749 + z \cdot \left(z + 15.234687407\right)\right)\right)}\\ \end{array} \]
Alternative 4
Accuracy95.4%
Cost2633
\[\begin{array}{l} \mathbf{if}\;z \leq -8.4 \cdot 10^{+46} \lor \neg \left(z \leq 2.6 \cdot 10^{+34}\right):\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot \left(a + z \cdot \left(t + z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right)\right)\right)\right)}{0.607771387771 + z \cdot \left(11.9400905721 + z \cdot \left(31.4690115749 + z \cdot \left(z + 15.234687407\right)\right)\right)}\\ \end{array} \]
Alternative 5
Accuracy93.0%
Cost1992
\[\begin{array}{l} \mathbf{if}\;z \leq -0.42:\\ \;\;\;\;x + \frac{y}{0.31942702700572795 + \frac{3.7269864963038164}{z}}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+14}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot \left(a + z \cdot \left(t + z \cdot \left(11.1667541262 + z \cdot 3.13060547623\right)\right)\right)\right)}{0.607771387771 + z \cdot 11.9400905721}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \left(36.52704169880642 \cdot \frac{1}{z} + -3.13060547623\right)\\ \end{array} \]
Alternative 6
Accuracy91.4%
Cost1865
\[\begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+48} \lor \neg \left(z \leq 1.26 \cdot 10^{+33}\right):\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot a\right)}{0.607771387771 + z \cdot \left(11.9400905721 + z \cdot \left(31.4690115749 + z \cdot \left(z + 15.234687407\right)\right)\right)}\\ \end{array} \]
Alternative 7
Accuracy89.3%
Cost1352
\[\begin{array}{l} \mathbf{if}\;z \leq -13:\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{elif}\;z \leq 34000000000000:\\ \;\;\;\;x + \frac{y \cdot b + a \cdot \left(z \cdot y\right)}{0.607771387771 + z \cdot 11.9400905721}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \left(36.52704169880642 \cdot \frac{1}{z} + -3.13060547623\right)\\ \end{array} \]
Alternative 8
Accuracy83.9%
Cost1224
\[\begin{array}{l} \mathbf{if}\;z \leq -0.75:\\ \;\;\;\;x + \frac{y}{0.31942702700572795 + \frac{3.7269864963038164}{z}}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+29}:\\ \;\;\;\;x + \frac{y \cdot b}{0.607771387771 + z \cdot \left(11.9400905721 + z \cdot 31.4690115749\right)}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot 3.13060547623\\ \end{array} \]
Alternative 9
Accuracy83.6%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -0.75 \lor \neg \left(z \leq 2.1 \cdot 10^{+39}\right):\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot b\right) \cdot 1.6453555072203998\\ \end{array} \]
Alternative 10
Accuracy83.8%
Cost712
\[\begin{array}{l} \mathbf{if}\;z \leq -0.165:\\ \;\;\;\;x + \frac{y}{0.31942702700572795 + \frac{3.7269864963038164}{z}}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+28}:\\ \;\;\;\;x + \left(y \cdot b\right) \cdot 1.6453555072203998\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot 3.13060547623\\ \end{array} \]
Alternative 11
Accuracy52.4%
Cost456
\[\begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+112}:\\ \;\;\;\;y \cdot 3.13060547623\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+175}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot 3.13060547623\\ \end{array} \]
Alternative 12
Accuracy63.2%
Cost320
\[x + y \cdot 3.13060547623 \]
Alternative 13
Accuracy46.9%
Cost64
\[x \]

Reproduce?

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