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

Percentage Accurate: 58.6% → 97.4%
Time: 14.8s
Alternatives: 14
Speedup: 11.3×

Specification

?
\[\begin{array}{l} \\ 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} \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))))
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));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static 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));
}
def code(x, y, z, t, a, 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))
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 tmp = code(x, y, z, t, a, b)
	tmp = 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));
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]
\begin{array}{l}

\\
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}
\end{array}

Sampling outcomes in binary64 precision:

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.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
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.

Initial Program: 58.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 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} \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))))
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));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x + ((y * ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0))
end function
public static 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));
}
def code(x, y, z, t, a, 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))
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 tmp = code(x, y, z, t, a, b)
	tmp = 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));
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]
\begin{array}{l}

\\
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}
\end{array}

Alternative 1: 97.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z \cdot z}\\ t_2 := \mathsf{fma}\left(3.13060547623, y, \mathsf{fma}\left(t\_1, t, \frac{y}{z} \cdot 11.1667541262\right) - \mathsf{fma}\left(t\_1, 98.5170599679272, \mathsf{fma}\left(47.69379582500642, \frac{y}{z}, \frac{-556.47806218377 \cdot y}{z \cdot z}\right)\right)\right) + x\\ \mathbf{if}\;z \leq -1.02 \cdot 10^{+39}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+22}:\\ \;\;\;\;\frac{\frac{y}{\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} + x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ y (* z z)))
        (t_2
         (+
          (fma
           3.13060547623
           y
           (-
            (fma t_1 t (* (/ y z) 11.1667541262))
            (fma
             t_1
             98.5170599679272
             (fma
              47.69379582500642
              (/ y z)
              (/ (* -556.47806218377 y) (* z z))))))
          x)))
   (if (<= z -1.02e+39)
     t_2
     (if (<= z 3.2e+22)
       (+
        (/
         (/
          y
          (/
           1.0
           (fma (fma (fma (fma 3.13060547623 z 11.1667541262) z t) z a) z b)))
         (+
          (*
           (+ (* (+ (* (+ 15.234687407 z) z) 31.4690115749) z) 11.9400905721)
           z)
          0.607771387771))
        x)
       t_2))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y / (z * z);
	double t_2 = fma(3.13060547623, y, (fma(t_1, t, ((y / z) * 11.1667541262)) - fma(t_1, 98.5170599679272, fma(47.69379582500642, (y / z), ((-556.47806218377 * y) / (z * z)))))) + x;
	double tmp;
	if (z <= -1.02e+39) {
		tmp = t_2;
	} else if (z <= 3.2e+22) {
		tmp = ((y / (1.0 / fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b))) / (((((((15.234687407 + z) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)) + x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(y / Float64(z * z))
	t_2 = Float64(fma(3.13060547623, y, Float64(fma(t_1, t, Float64(Float64(y / z) * 11.1667541262)) - fma(t_1, 98.5170599679272, fma(47.69379582500642, Float64(y / z), Float64(Float64(-556.47806218377 * y) / Float64(z * z)))))) + x)
	tmp = 0.0
	if (z <= -1.02e+39)
		tmp = t_2;
	elseif (z <= 3.2e+22)
		tmp = Float64(Float64(Float64(y / Float64(1.0 / fma(fma(fma(fma(3.13060547623, z, 11.1667541262), z, t), z, a), z, b))) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(15.234687407 + z) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771)) + x);
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(3.13060547623 * y + N[(N[(t$95$1 * t + N[(N[(y / z), $MachinePrecision] * 11.1667541262), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * 98.5170599679272 + N[(47.69379582500642 * N[(y / z), $MachinePrecision] + N[(N[(-556.47806218377 * y), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -1.02e+39], t$95$2, If[LessEqual[z, 3.2e+22], N[(N[(N[(y / N[(1.0 / N[(N[(N[(N[(3.13060547623 * z + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] * z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(15.234687407 + z), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot z}\\
t_2 := \mathsf{fma}\left(3.13060547623, y, \mathsf{fma}\left(t\_1, t, \frac{y}{z} \cdot 11.1667541262\right) - \mathsf{fma}\left(t\_1, 98.5170599679272, \mathsf{fma}\left(47.69379582500642, \frac{y}{z}, \frac{-556.47806218377 \cdot y}{z \cdot z}\right)\right)\right) + x\\
\mathbf{if}\;z \leq -1.02 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+22}:\\
\;\;\;\;\frac{\frac{y}{\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} + x\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.02e39 or 3.2e22 < z

    1. Initial program 5.8%

      \[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. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto x + \color{blue}{\left(\left(\frac{313060547623}{100000000000} \cdot y + \left(\frac{55833770631}{5000000000} \cdot \frac{y}{z} + \frac{t \cdot y}{{z}^{2}}\right)\right) - \left(\frac{15234687407}{1000000000} \cdot \frac{\frac{55833770631}{5000000000} \cdot y - \frac{4769379582500641883561}{100000000000000000000} \cdot y}{{z}^{2}} + \left(\frac{4769379582500641883561}{100000000000000000000} \cdot \frac{y}{z} + \frac{98517059967927196814627}{1000000000000000000000} \cdot \frac{y}{{z}^{2}}\right)\right)\right)} \]
    4. Applied rewrites97.3%

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

    if -1.02e39 < z < 3.2e22

    1. Initial program 99.1%

      \[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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{y \cdot \left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}}{\left(\left(\left(z + \frac{15234687407}{1000000000}\right) \cdot z + \frac{314690115749}{10000000000}\right) \cdot z + \frac{119400905721}{10000000000}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
      2. lift-+.f64N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}}{\left(\left(\left(z + \frac{15234687407}{1000000000}\right) \cdot z + \frac{314690115749}{10000000000}\right) \cdot z + \frac{119400905721}{10000000000}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
      3. flip-+N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\frac{\left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) \cdot \left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) - b \cdot b}{\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z - b}}}{\left(\left(\left(z + \frac{15234687407}{1000000000}\right) \cdot z + \frac{314690115749}{10000000000}\right) \cdot z + \frac{119400905721}{10000000000}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
      4. clear-numN/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\frac{1}{\frac{\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z - b}{\left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) \cdot \left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) - b \cdot b}}}}{\left(\left(\left(z + \frac{15234687407}{1000000000}\right) \cdot z + \frac{314690115749}{10000000000}\right) \cdot z + \frac{119400905721}{10000000000}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
      5. un-div-invN/A

        \[\leadsto x + \frac{\color{blue}{\frac{y}{\frac{\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z - b}{\left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) \cdot \left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) - b \cdot b}}}}{\left(\left(\left(z + \frac{15234687407}{1000000000}\right) \cdot z + \frac{314690115749}{10000000000}\right) \cdot z + \frac{119400905721}{10000000000}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
      6. lower-/.f64N/A

        \[\leadsto x + \frac{\color{blue}{\frac{y}{\frac{\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z - b}{\left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) \cdot \left(\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z\right) - b \cdot b}}}}{\left(\left(\left(z + \frac{15234687407}{1000000000}\right) \cdot z + \frac{314690115749}{10000000000}\right) \cdot z + \frac{119400905721}{10000000000}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
    4. Applied rewrites99.2%

      \[\leadsto x + \frac{\color{blue}{\frac{y}{\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}}}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+39}:\\ \;\;\;\;\mathsf{fma}\left(3.13060547623, y, \mathsf{fma}\left(\frac{y}{z \cdot z}, t, \frac{y}{z} \cdot 11.1667541262\right) - \mathsf{fma}\left(\frac{y}{z \cdot z}, 98.5170599679272, \mathsf{fma}\left(47.69379582500642, \frac{y}{z}, \frac{-556.47806218377 \cdot y}{z \cdot z}\right)\right)\right) + x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+22}:\\ \;\;\;\;\frac{\frac{y}{\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(3.13060547623, z, 11.1667541262\right), z, t\right), z, a\right), z, b\right)}}}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(3.13060547623, y, \mathsf{fma}\left(\frac{y}{z \cdot z}, t, \frac{y}{z} \cdot 11.1667541262\right) - \mathsf{fma}\left(\frac{y}{z \cdot z}, 98.5170599679272, \mathsf{fma}\left(47.69379582500642, \frac{y}{z}, \frac{-556.47806218377 \cdot y}{z \cdot z}\right)\right)\right) + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 71.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(\left(\left(\left(3.13060547623 \cdot z + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right) \cdot y}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+175}:\\ \;\;\;\;\left(1.6453555072203998 \cdot b\right) \cdot y\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-43}:\\ \;\;\;\;1 \cdot x\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\left(1.6453555072203998 \cdot y\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1
         (/
          (*
           (+
            (* (+ (* (+ (* (+ (* 3.13060547623 z) 11.1667541262) z) t) z) a) z)
            b)
           y)
          (+
           (*
            (+ (* (+ (* (+ 15.234687407 z) z) 31.4690115749) z) 11.9400905721)
            z)
           0.607771387771))))
   (if (<= t_1 -1e+175)
     (* (* 1.6453555072203998 b) y)
     (if (<= t_1 5e-43)
       (* 1.0 x)
       (if (<= t_1 INFINITY)
         (* (* 1.6453555072203998 y) b)
         (fma 3.13060547623 y x))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (((((((((3.13060547623 * z) + 11.1667541262) * z) + t) * z) + a) * z) + b) * y) / (((((((15.234687407 + z) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771);
	double tmp;
	if (t_1 <= -1e+175) {
		tmp = (1.6453555072203998 * b) * y;
	} else if (t_1 <= 5e-43) {
		tmp = 1.0 * x;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (1.6453555072203998 * y) * b;
	} else {
		tmp = fma(3.13060547623, y, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(3.13060547623 * z) + 11.1667541262) * z) + t) * z) + a) * z) + b) * y) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(15.234687407 + z) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771))
	tmp = 0.0
	if (t_1 <= -1e+175)
		tmp = Float64(Float64(1.6453555072203998 * b) * y);
	elseif (t_1 <= 5e-43)
		tmp = Float64(1.0 * x);
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(1.6453555072203998 * y) * b);
	else
		tmp = fma(3.13060547623, y, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(N[(N[(3.13060547623 * z), $MachinePrecision] + 11.1667541262), $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision] * z), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(15.234687407 + z), $MachinePrecision] * z), $MachinePrecision] + 31.4690115749), $MachinePrecision] * z), $MachinePrecision] + 11.9400905721), $MachinePrecision] * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+175], N[(N[(1.6453555072203998 * b), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 5e-43], N[(1.0 * x), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(1.6453555072203998 * y), $MachinePrecision] * b), $MachinePrecision], N[(3.13060547623 * y + x), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(\left(\left(\left(3.13060547623 \cdot z + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right) \cdot y}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+175}:\\
\;\;\;\;\left(1.6453555072203998 \cdot b\right) \cdot y\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-43}:\\
\;\;\;\;1 \cdot x\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(1.6453555072203998 \cdot y\right) \cdot b\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < -9.9999999999999994e174

    1. Initial program 85.2%

      \[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. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{x + \frac{1000000000000}{607771387771} \cdot \left(b \cdot y\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{1000000000000}{607771387771} \cdot \left(b \cdot y\right) + x} \]
      2. *-commutativeN/A

        \[\leadsto \frac{1000000000000}{607771387771} \cdot \color{blue}{\left(y \cdot b\right)} + x \]
      3. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1000000000000}{607771387771} \cdot y\right) \cdot b} + x \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1000000000000}{607771387771} \cdot y, b, x\right)} \]
      5. lower-*.f6459.8

        \[\leadsto \mathsf{fma}\left(\color{blue}{1.6453555072203998 \cdot y}, b, x\right) \]
    5. Applied rewrites59.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1.6453555072203998 \cdot y, b, x\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites59.7%

        \[\leadsto \mathsf{fma}\left(b \cdot 1.6453555072203998, \color{blue}{y}, x\right) \]
      2. Taylor expanded in x around inf

        \[\leadsto x \cdot \color{blue}{\left(1 + \frac{1000000000000}{607771387771} \cdot \frac{b \cdot y}{x}\right)} \]
      3. Step-by-step derivation
        1. Applied rewrites53.2%

          \[\leadsto \mathsf{fma}\left(x \cdot 1.6453555072203998, \color{blue}{\frac{y}{x} \cdot b}, x\right) \]
        2. Taylor expanded in b around inf

          \[\leadsto \frac{1000000000000}{607771387771} \cdot \color{blue}{\left(b \cdot y\right)} \]
        3. Step-by-step derivation
          1. Applied rewrites51.6%

            \[\leadsto \left(1.6453555072203998 \cdot b\right) \cdot \color{blue}{y} \]

          if -9.9999999999999994e174 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < 5.00000000000000019e-43

          1. Initial program 99.7%

            \[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. Add Preprocessing
          3. Taylor expanded in z around inf

            \[\leadsto \color{blue}{x + \frac{313060547623}{100000000000} \cdot y} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{\frac{313060547623}{100000000000} \cdot y + x} \]
            2. lower-fma.f6460.9

              \[\leadsto \color{blue}{\mathsf{fma}\left(3.13060547623, y, x\right)} \]
          5. Applied rewrites60.9%

            \[\leadsto \color{blue}{\mathsf{fma}\left(3.13060547623, y, x\right)} \]
          6. Taylor expanded in x around inf

            \[\leadsto x \cdot \color{blue}{\left(1 + \frac{313060547623}{100000000000} \cdot \frac{y}{x}\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites60.7%

              \[\leadsto \mathsf{fma}\left(\frac{y}{x}, 3.13060547623, 1\right) \cdot \color{blue}{x} \]
            2. Taylor expanded in y around 0

              \[\leadsto 1 \cdot x \]
            3. Step-by-step derivation
              1. Applied rewrites65.4%

                \[\leadsto 1 \cdot x \]

              if 5.00000000000000019e-43 < (/.f64 (*.f64 y (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z #s(literal 313060547623/100000000000 binary64)) #s(literal 55833770631/5000000000 binary64)) z) t) z) a) z) b)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z #s(literal 15234687407/1000000000 binary64)) z) #s(literal 314690115749/10000000000 binary64)) z) #s(literal 119400905721/10000000000 binary64)) z) #s(literal 607771387771/1000000000000 binary64))) < +inf.0

              1. Initial program 92.5%

                \[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. Add Preprocessing
              3. Taylor expanded in b around inf

                \[\leadsto \color{blue}{\frac{b \cdot y}{\frac{607771387771}{1000000000000} + z \cdot \left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right)\right)}} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{\color{blue}{y \cdot b}}{\frac{607771387771}{1000000000000} + z \cdot \left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right)\right)} \]
                2. associate-*l/N/A

                  \[\leadsto \color{blue}{\frac{y}{\frac{607771387771}{1000000000000} + z \cdot \left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right)\right)} \cdot b} \]
                3. lower-*.f64N/A

                  \[\leadsto \color{blue}{\frac{y}{\frac{607771387771}{1000000000000} + z \cdot \left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right)\right)} \cdot b} \]
                4. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{y}{\frac{607771387771}{1000000000000} + z \cdot \left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right)\right)}} \cdot b \]
                5. +-commutativeN/A

                  \[\leadsto \frac{y}{\color{blue}{z \cdot \left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right)\right) + \frac{607771387771}{1000000000000}}} \cdot b \]
                6. *-commutativeN/A

                  \[\leadsto \frac{y}{\color{blue}{\left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right)\right) \cdot z} + \frac{607771387771}{1000000000000}} \cdot b \]
                7. lower-fma.f64N/A

                  \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(\frac{119400905721}{10000000000} + z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right), z, \frac{607771387771}{1000000000000}\right)}} \cdot b \]
                8. +-commutativeN/A

                  \[\leadsto \frac{y}{\mathsf{fma}\left(\color{blue}{z \cdot \left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right) + \frac{119400905721}{10000000000}}, z, \frac{607771387771}{1000000000000}\right)} \cdot b \]
                9. *-commutativeN/A

                  \[\leadsto \frac{y}{\mathsf{fma}\left(\color{blue}{\left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right)\right) \cdot z} + \frac{119400905721}{10000000000}, z, \frac{607771387771}{1000000000000}\right)} \cdot b \]
                10. lower-fma.f64N/A

                  \[\leadsto \frac{y}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{314690115749}{10000000000} + z \cdot \left(\frac{15234687407}{1000000000} + z\right), z, \frac{119400905721}{10000000000}\right)}, z, \frac{607771387771}{1000000000000}\right)} \cdot b \]
                11. +-commutativeN/A

                  \[\leadsto \frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{z \cdot \left(\frac{15234687407}{1000000000} + z\right) + \frac{314690115749}{10000000000}}, z, \frac{119400905721}{10000000000}\right), z, \frac{607771387771}{1000000000000}\right)} \cdot b \]
                12. *-commutativeN/A

                  \[\leadsto \frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(\frac{15234687407}{1000000000} + z\right) \cdot z} + \frac{314690115749}{10000000000}, z, \frac{119400905721}{10000000000}\right), z, \frac{607771387771}{1000000000000}\right)} \cdot b \]
                13. lower-fma.f64N/A

                  \[\leadsto \frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{15234687407}{1000000000} + z, z, \frac{314690115749}{10000000000}\right)}, z, \frac{119400905721}{10000000000}\right), z, \frac{607771387771}{1000000000000}\right)} \cdot b \]
                14. lower-+.f6445.5

                  \[\leadsto \frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{15.234687407 + z}, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)} \cdot b \]
              5. Applied rewrites45.5%

                \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(15.234687407 + z, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)} \cdot b} \]
              6. Taylor expanded in z around 0

                \[\leadsto \left(\frac{1000000000000}{607771387771} \cdot y\right) \cdot b \]
              7. Step-by-step derivation
                1. Applied rewrites43.4%

                  \[\leadsto \left(1.6453555072203998 \cdot y\right) \cdot b \]

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

                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. Add Preprocessing
                3. Taylor expanded in z around inf

                  \[\leadsto \color{blue}{x + \frac{313060547623}{100000000000} \cdot y} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{313060547623}{100000000000} \cdot y + x} \]
                  2. lower-fma.f6497.5

                    \[\leadsto \color{blue}{\mathsf{fma}\left(3.13060547623, y, x\right)} \]
                5. Applied rewrites97.5%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(3.13060547623, y, x\right)} \]
              8. Recombined 4 regimes into one program.
              9. Final simplification71.4%

                \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(\left(\left(\left(3.13060547623 \cdot z + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right) \cdot y}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq -1 \cdot 10^{+175}:\\ \;\;\;\;\left(1.6453555072203998 \cdot b\right) \cdot y\\ \mathbf{elif}\;\frac{\left(\left(\left(\left(3.13060547623 \cdot z + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right) \cdot y}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq 5 \cdot 10^{-43}:\\ \;\;\;\;1 \cdot x\\ \mathbf{elif}\;\frac{\left(\left(\left(\left(3.13060547623 \cdot z + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right) \cdot y}{\left(\left(\left(15.234687407 + z\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \leq \infty:\\ \;\;\;\;\left(1.6453555072203998 \cdot y\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(3.13060547623, y, x\right)\\ \end{array} \]
              10. Add Preprocessing

              Developer Target 1: 98.5% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(\left(3.13060547623 - \frac{36.527041698806414}{z}\right) + \frac{t}{z \cdot z}\right) \cdot \frac{y}{1}\\ \mathbf{if}\;z < -6.499344996252632 \cdot 10^{+53}:\\ \;\;\;\;t\_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}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t a b)
               :precision binary64
               (let* ((t_1
                       (+
                        x
                        (*
                         (+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (* z z)))
                         (/ y 1.0)))))
                 (if (< z -6.499344996252632e+53)
                   t_1
                   (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))))
                     t_1))))
              double code(double x, double y, double z, double t, double a, double b) {
              	double t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0));
              	double tmp;
              	if (z < -6.499344996252632e+53) {
              		tmp = t_1;
              	} else if (z < 7.066965436914287e+59) {
              		tmp = 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)));
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z, t, a, b)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  real(8) :: t_1
                  real(8) :: tmp
                  t_1 = x + (((3.13060547623d0 - (36.527041698806414d0 / z)) + (t / (z * z))) * (y / 1.0d0))
                  if (z < (-6.499344996252632d+53)) then
                      tmp = t_1
                  else if (z < 7.066965436914287d+59) then
                      tmp = x + (y / ((((((((z + 15.234687407d0) * z) + 31.4690115749d0) * z) + 11.9400905721d0) * z) + 0.607771387771d0) / ((((((((z * 3.13060547623d0) + 11.1667541262d0) * z) + t) * z) + a) * z) + b)))
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t, double a, double b) {
              	double t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0));
              	double tmp;
              	if (z < -6.499344996252632e+53) {
              		tmp = t_1;
              	} else if (z < 7.066965436914287e+59) {
              		tmp = 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)));
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t, a, b):
              	t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0))
              	tmp = 0
              	if z < -6.499344996252632e+53:
              		tmp = t_1
              	elif z < 7.066965436914287e+59:
              		tmp = 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)))
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t, a, b)
              	t_1 = Float64(x + Float64(Float64(Float64(3.13060547623 - Float64(36.527041698806414 / z)) + Float64(t / Float64(z * z))) * Float64(y / 1.0)))
              	tmp = 0.0
              	if (z < -6.499344996252632e+53)
              		tmp = t_1;
              	elseif (z < 7.066965436914287e+59)
              		tmp = Float64(x + Float64(y / Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b))));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t, a, b)
              	t_1 = x + (((3.13060547623 - (36.527041698806414 / z)) + (t / (z * z))) * (y / 1.0));
              	tmp = 0.0;
              	if (z < -6.499344996252632e+53)
              		tmp = t_1;
              	elseif (z < 7.066965436914287e+59)
              		tmp = 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)));
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(N[(3.13060547623 - N[(36.527041698806414 / z), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -6.499344996252632e+53], t$95$1, If[Less[z, 7.066965436914287e+59], N[(x + N[(y / N[(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] / 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]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := x + \left(\left(3.13060547623 - \frac{36.527041698806414}{z}\right) + \frac{t}{z \cdot z}\right) \cdot \frac{y}{1}\\
              \mathbf{if}\;z < -6.499344996252632 \cdot 10^{+53}:\\
              \;\;\;\;t\_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}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              

              Reproduce

              ?
              herbie shell --seed 2024230 
              (FPCore (x y z t a b)
                :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D"
                :precision binary64
              
                :alt
                (! :herbie-platform default (if (< z -649934499625263200000000000000000000000000000000000000) (+ x (* (+ (- 313060547623/100000000000 (/ 18263520849403207/500000000000000 z)) (/ t (* z z))) (/ y 1))) (if (< z 706696543691428700000000000000000000000000000000000000000000) (+ x (/ y (/ (+ (* (+ (* (+ (* (+ z 15234687407/1000000000) z) 314690115749/10000000000) z) 119400905721/10000000000) z) 607771387771/1000000000000) (+ (* (+ (* (+ (* (+ (* z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b)))) (+ x (* (+ (- 313060547623/100000000000 (/ 18263520849403207/500000000000000 z)) (/ t (* z z))) (/ y 1))))))
              
                (+ 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))))