Average Error: 28.7 → 11.4
Time: 50.3s
Precision: binary64
\[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
\[\begin{array}{l} t_1 := \left(\frac{z}{y} + x\right) - \frac{x \cdot a}{y}\\ \mathbf{if}\;y \leq -1.535105735609914 \cdot 10^{+56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.2643423819508104 \cdot 10^{+57}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, 27464.7644705 + \left(x \cdot {y}^{2} + y \cdot z\right), 230661.510616\right), t\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\begin{array}{l}
t_1 := \left(\frac{z}{y} + x\right) - \frac{x \cdot a}{y}\\
\mathbf{if}\;y \leq -1.535105735609914 \cdot 10^{+56}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.2643423819508104 \cdot 10^{+57}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, 27464.7644705 + \left(x \cdot {y}^{2} + y \cdot z\right), 230661.510616\right), t\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
(FPCore (x y z t a b c i)
 :precision binary64
 (/
  (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t)
  (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ (/ z y) x) (/ (* x a) y))))
   (if (<= y -1.535105735609914e+56)
     t_1
     (if (<= y 1.2643423819508104e+57)
       (/
        (fma
         y
         (fma y (+ 27464.7644705 (+ (* x (pow y 2.0)) (* y z))) 230661.510616)
         t)
        (fma y (fma y (fma y (+ y a) b) c) i))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((z / y) + x) - ((x * a) / y);
	double tmp;
	if (y <= -1.535105735609914e+56) {
		tmp = t_1;
	} else if (y <= 1.2643423819508104e+57) {
		tmp = fma(y, fma(y, (27464.7644705 + ((x * pow(y, 2.0)) + (y * z))), 230661.510616), t) / fma(y, fma(y, fma(y, (y + a), b), c), i);
	} else {
		tmp = t_1;
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Derivation

  1. Split input into 2 regimes
  2. if y < -1.5351057356099139e56 or 1.26434238195081038e57 < y

    1. Initial program 62.6

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Simplified62.6

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}} \]
    3. Taylor expanded in y around inf 20.8

      \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right) - \frac{a \cdot x}{y}} \]

    if -1.5351057356099139e56 < y < 1.26434238195081038e57

    1. Initial program 4.7

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Simplified4.7

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}} \]
    3. Taylor expanded in y around 0 4.7

      \[\leadsto \frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{27464.7644705 + \left(y \cdot z + {y}^{2} \cdot x\right)}, 230661.510616\right), t\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)} \]
    4. Applied +-commutative_binary644.7

      \[\leadsto \frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, 27464.7644705 + \color{blue}{\left({y}^{2} \cdot x + y \cdot z\right)}, 230661.510616\right), t\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification11.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.535105735609914 \cdot 10^{+56}:\\ \;\;\;\;\left(\frac{z}{y} + x\right) - \frac{x \cdot a}{y}\\ \mathbf{elif}\;y \leq 1.2643423819508104 \cdot 10^{+57}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, 27464.7644705 + \left(x \cdot {y}^{2} + y \cdot z\right), 230661.510616\right), t\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{z}{y} + x\right) - \frac{x \cdot a}{y}\\ \end{array} \]

Reproduce

herbie shell --seed 2022097 
(FPCore (x y z t a b c i)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2"
  :precision binary64
  (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))