Average Error: 29.0 → 0.4
Time: 1.8m
Precision: 64
Internal precision: 128
\[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 \le -741687408416398.6:\\ \;\;\;\;\left(\frac{t}{z} - 36.527041698806414\right) \cdot \frac{y}{z} + \left(y \cdot 3.13060547623 + x\right)\\ \mathbf{if}\;z \le 7.708214234365678 \cdot 10^{+48}:\\ \;\;\;\;x + \frac{y}{1} \cdot \frac{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{t}{z} - 36.527041698806414\right) \cdot \frac{y}{z} + \left(y \cdot 3.13060547623 + x\right)\\ \end{array}\]

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

Target

Original29.0
Comparison1.2
Herbie0.4
\[ \begin{array}{l} \mathbf{if}\;z \lt -6.499344996252632 \cdot 10^{+53}:\\ \;\;\;\;x + \left(\left(3.13060547623 - \frac{36.527041698806414}{z}\right) + \frac{t}{{z}^2}\right) \cdot \frac{y}{1}\\ \mathbf{if}\;z \lt 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}^2}\right) \cdot \frac{y}{1}\\ \end{array} \]

Derivation

  1. Split input into 2 regimes.
  2. if z < -741687408416398.6 or 7.708214234365678e+48 < z

    1. Initial program 57.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. Applied taylor 7.0

      \[\leadsto x + \left(\left(\frac{t \cdot y}{{z}^2} + 3.13060547623 \cdot y\right) - 36.527041698806414 \cdot \frac{y}{z}\right)\]
    3. Taylor expanded around inf 7.0

      \[\leadsto x + \color{blue}{\left(\left(\frac{t \cdot y}{{z}^2} + 3.13060547623 \cdot y\right) - 36.527041698806414 \cdot \frac{y}{z}\right)}\]
    4. Applied simplify 0.2

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

    if -741687408416398.6 < z < 7.708214234365678e+48

    1. Initial program 1.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. Using strategy rm
    3. Applied *-un-lft-identity 1.5

      \[\leadsto 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)}{\color{blue}{1 \cdot \left(\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771\right)}}\]
    4. Applied times-frac 0.6

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b}{\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. Removed slow pow expressions

Runtime

Time bar (total: 1.8m) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1746587219 3530605687 931079059 713632144 176823923 469485661)'
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D"

  :target
  (if (< z -6.499344996252632e+53) (+ x (* (+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (sqr z))) (/ y 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)))) (+ x (* (+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (sqr 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))))