Average Error: 29.3 → 0.5
Time: 28.9s
Precision: binary64
Cost: 46665
\[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 -3.3 \cdot 10^{+31} \lor \neg \left(z \leq 1.28 \cdot 10^{+42}\right):\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623 + \left(\frac{457.9610022158428}{z \cdot z} + \left(\left(\frac{t}{z \cdot z} + \frac{a + \left(-5864.8025282699045 - t \cdot 15.234687407\right)}{{z}^{3}}\right) + \frac{-36.52704169880642}{z}\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(\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) \cdot \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}\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 -3.3e+31) (not (<= z 1.28e+42)))
   (fma
    y
    (+
     3.13060547623
     (+
      (/ 457.9610022158428 (* z z))
      (+
       (+
        (/ t (* z z))
        (/ (+ a (- -5864.8025282699045 (* t 15.234687407))) (pow z 3.0)))
       (/ -36.52704169880642 z))))
    x)
   (+
    x
    (*
     y
     (*
      (fma (fma (fma (fma z 3.13060547623 11.1667541262) z t) z a) z b)
      (/
       1.0
       (fma
        (fma (fma (+ 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));
}
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((z <= -3.3e+31) || !(z <= 1.28e+42)) {
		tmp = fma(y, (3.13060547623 + ((457.9610022158428 / (z * z)) + (((t / (z * z)) + ((a + (-5864.8025282699045 - (t * 15.234687407))) / pow(z, 3.0))) + (-36.52704169880642 / z)))), x);
	} else {
		tmp = x + (y * (fma(fma(fma(fma(z, 3.13060547623, 11.1667541262), z, t), z, a), z, b) * (1.0 / fma(fma(fma((z + 15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771))));
	}
	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 <= -3.3e+31) || !(z <= 1.28e+42))
		tmp = fma(y, Float64(3.13060547623 + Float64(Float64(457.9610022158428 / Float64(z * z)) + Float64(Float64(Float64(t / Float64(z * z)) + Float64(Float64(a + Float64(-5864.8025282699045 - Float64(t * 15.234687407))) / (z ^ 3.0))) + Float64(-36.52704169880642 / z)))), x);
	else
		tmp = Float64(x + Float64(y * Float64(fma(fma(fma(fma(z, 3.13060547623, 11.1667541262), z, t), z, a), z, b) * Float64(1.0 / fma(fma(fma(Float64(z + 15.234687407), z, 31.4690115749), z, 11.9400905721), z, 0.607771387771)))));
	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, -3.3e+31], N[Not[LessEqual[z, 1.28e+42]], $MachinePrecision]], N[(y * N[(3.13060547623 + N[(N[(457.9610022158428 / N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t / N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a + N[(-5864.8025282699045 - N[(t * 15.234687407), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[z, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-36.52704169880642 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y * N[(N[(N[(N[(N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision] * z + t), $MachinePrecision] * z + a), $MachinePrecision] * z + b), $MachinePrecision] * N[(1.0 / N[(N[(N[(N[(z + 15.234687407), $MachinePrecision] * z + 31.4690115749), $MachinePrecision] * z + 11.9400905721), $MachinePrecision] * z + 0.607771387771), $MachinePrecision]), $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 -3.3 \cdot 10^{+31} \lor \neg \left(z \leq 1.28 \cdot 10^{+42}\right):\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623 + \left(\frac{457.9610022158428}{z \cdot z} + \left(\left(\frac{t}{z \cdot z} + \frac{a + \left(-5864.8025282699045 - t \cdot 15.234687407\right)}{{z}^{3}}\right) + \frac{-36.52704169880642}{z}\right)\right), x\right)\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\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) \cdot \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}\right)\\


\end{array}

Error

Target

Original29.3
Target1.0
Herbie0.5
\[\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 < -3.29999999999999992e31 or 1.28000000000000004e42 < z

    1. Initial program 59.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. Simplified57.3

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{\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)}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z + 15.234687407, 31.4690115749\right), 11.9400905721\right), 0.607771387771\right)}, x\right)} \]
      Proof
      (fma.f64 y (/.f64 (fma.f64 z (fma.f64 z (fma.f64 z (fma.f64 z 313060547623/100000000000 55833770631/5000000000) t) a) b) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (fma.f64 z (fma.f64 z (fma.f64 z (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000)) t) a) b) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 1 points decrease in error
      (fma.f64 y (/.f64 (fma.f64 z (fma.f64 z (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000)) t)) a) b) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (fma.f64 z (fma.f64 z (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z)) t) a) b) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (fma.f64 z (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t)) a)) b) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (fma.f64 z (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z)) a) b) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a)) b)) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 1 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z)) b) (fma.f64 z (fma.f64 z (fma.f64 z (+.f64 z 15234687407/1000000000) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b) (fma.f64 z (fma.f64 z (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (+.f64 z 15234687407/1000000000)) 314690115749/10000000000)) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b) (fma.f64 z (fma.f64 z (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 z 15234687407/1000000000) z)) 314690115749/10000000000) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b) (fma.f64 z (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (+.f64 (*.f64 (+.f64 z 15234687407/1000000000) z) 314690115749/10000000000)) 119400905721/10000000000)) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b) (fma.f64 z (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 (+.f64 z 15234687407/1000000000) z) 314690115749/10000000000) z)) 119400905721/10000000000) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z 15234687407/1000000000) z) 314690115749/10000000000) z) 119400905721/10000000000)) 607771387771/1000000000000))) x): 0 points increase in error, 0 points decrease in error
      (fma.f64 y (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 z 313060547623/100000000000) 55833770631/5000000000) z) t) z) a) z) b) (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 z 15234687407/1000000000) z) 314690115749/10000000000) z) 119400905721/10000000000) z)) 607771387771/1000000000000)) x): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 y (/.f64 (+.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))) x)): 1 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> associate-*r/_binary64 (/.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))) x): 21 points increase in error, 8 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 x (/.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)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in z around -inf 0.6

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\left(3.13060547623 + \left(457.9610022158428 \cdot \frac{1}{{z}^{2}} + \left(\frac{t}{{z}^{2}} + -1 \cdot \frac{-1 \cdot a - \left(1112.0901850848957 + -15.234687407 \cdot \left(457.9610022158428 + t\right)\right)}{{z}^{3}}\right)\right)\right) - 36.52704169880642 \cdot \frac{1}{z}}, x\right) \]
    4. Simplified0.6

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{3.13060547623 + \left(\frac{457.9610022158428}{z \cdot z} + \left(\left(\frac{t}{z \cdot z} - \frac{\left(-a\right) - \left(-5864.8025282699045 + t \cdot -15.234687407\right)}{{z}^{3}}\right) - \frac{36.52704169880642}{z}\right)\right)}, x\right) \]
      Proof
      (+.f64 313060547623/100000000000 (+.f64 (/.f64 45796100221584283915100827016327/100000000000000000000000000000 (*.f64 z z)) (-.f64 (-.f64 (/.f64 t (*.f64 z z)) (/.f64 (-.f64 (neg.f64 a) (+.f64 -586480252826990429730394679450703430294089/100000000000000000000000000000000000000 (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (/.f64 (Rewrite<= metadata-eval (*.f64 45796100221584283915100827016327/100000000000000000000000000000 1)) (*.f64 z z)) (-.f64 (-.f64 (/.f64 t (*.f64 z z)) (/.f64 (-.f64 (neg.f64 a) (+.f64 -586480252826990429730394679450703430294089/100000000000000000000000000000000000000 (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (/.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 1) (Rewrite<= unpow2_binary64 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (*.f64 z z)) (/.f64 (-.f64 (neg.f64 a) (+.f64 -586480252826990429730394679450703430294089/100000000000000000000000000000000000000 (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (Rewrite<= associate-*r/_binary64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2)))) (-.f64 (-.f64 (/.f64 t (*.f64 z z)) (/.f64 (-.f64 (neg.f64 a) (+.f64 -586480252826990429730394679450703430294089/100000000000000000000000000000000000000 (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (Rewrite<= unpow2_binary64 (pow.f64 z 2))) (/.f64 (-.f64 (neg.f64 a) (+.f64 -586480252826990429730394679450703430294089/100000000000000000000000000000000000000 (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (pow.f64 z 2)) (/.f64 (-.f64 (Rewrite<= mul-1-neg_binary64 (*.f64 -1 a)) (+.f64 -586480252826990429730394679450703430294089/100000000000000000000000000000000000000 (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (pow.f64 z 2)) (/.f64 (-.f64 (*.f64 -1 a) (+.f64 (Rewrite<= metadata-eval (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 -697689271335479999750499226480922330294089/100000000000000000000000000000000000000)) (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (pow.f64 z 2)) (/.f64 (-.f64 (*.f64 -1 a) (+.f64 (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (Rewrite<= metadata-eval (*.f64 -15234687407/1000000000 45796100221584283915100827016327/100000000000000000000000000000))) (*.f64 t -15234687407/1000000000))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 1 points increase in error, 9 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (pow.f64 z 2)) (/.f64 (-.f64 (*.f64 -1 a) (+.f64 (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (*.f64 -15234687407/1000000000 45796100221584283915100827016327/100000000000000000000000000000)) (Rewrite<= *-commutative_binary64 (*.f64 -15234687407/1000000000 t)))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (pow.f64 z 2)) (/.f64 (-.f64 (*.f64 -1 a) (Rewrite<= associate-+r+_binary64 (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (+.f64 (*.f64 -15234687407/1000000000 45796100221584283915100827016327/100000000000000000000000000000) (*.f64 -15234687407/1000000000 t))))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (-.f64 (/.f64 t (pow.f64 z 2)) (/.f64 (-.f64 (*.f64 -1 a) (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (Rewrite<= distribute-lft-in_binary64 (*.f64 -15234687407/1000000000 (+.f64 45796100221584283915100827016327/100000000000000000000000000000 t))))) (pow.f64 z 3))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 1 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (/.f64 t (pow.f64 z 2)) (neg.f64 (/.f64 (-.f64 (*.f64 -1 a) (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (*.f64 -15234687407/1000000000 (+.f64 45796100221584283915100827016327/100000000000000000000000000000 t)))) (pow.f64 z 3))))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (+.f64 (/.f64 t (pow.f64 z 2)) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 a) (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (*.f64 -15234687407/1000000000 (+.f64 45796100221584283915100827016327/100000000000000000000000000000 t)))) (pow.f64 z 3))))) (/.f64 3652704169880641883561/100000000000000000000 z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (+.f64 (/.f64 t (pow.f64 z 2)) (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 a) (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (*.f64 -15234687407/1000000000 (+.f64 45796100221584283915100827016327/100000000000000000000000000000 t)))) (pow.f64 z 3)))) (/.f64 (Rewrite<= metadata-eval (*.f64 3652704169880641883561/100000000000000000000 1)) z)))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (-.f64 (+.f64 (/.f64 t (pow.f64 z 2)) (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 a) (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (*.f64 -15234687407/1000000000 (+.f64 45796100221584283915100827016327/100000000000000000000000000000 t)))) (pow.f64 z 3)))) (Rewrite<= associate-*r/_binary64 (*.f64 3652704169880641883561/100000000000000000000 (/.f64 1 z)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 313060547623/100000000000 (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (+.f64 (/.f64 t (pow.f64 z 2)) (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 a) (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (*.f64 -15234687407/1000000000 (+.f64 45796100221584283915100827016327/100000000000000000000000000000 t)))) (pow.f64 z 3))))) (*.f64 3652704169880641883561/100000000000000000000 (/.f64 1 z))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 313060547623/100000000000 (+.f64 (*.f64 45796100221584283915100827016327/100000000000000000000000000000 (/.f64 1 (pow.f64 z 2))) (+.f64 (/.f64 t (pow.f64 z 2)) (*.f64 -1 (/.f64 (-.f64 (*.f64 -1 a) (+.f64 1112090185084895700201045470302189/1000000000000000000000000000000 (*.f64 -15234687407/1000000000 (+.f64 45796100221584283915100827016327/100000000000000000000000000000 t)))) (pow.f64 z 3)))))) (*.f64 3652704169880641883561/100000000000000000000 (/.f64 1 z)))): 0 points increase in error, 0 points decrease in error

    if -3.29999999999999992e31 < z < 1.28000000000000004e42

    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. Applied egg-rr0.4

      \[\leadsto x + \color{blue}{y \cdot \left(\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) \cdot \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+31} \lor \neg \left(z \leq 1.28 \cdot 10^{+42}\right):\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623 + \left(\frac{457.9610022158428}{z \cdot z} + \left(\left(\frac{t}{z \cdot z} + \frac{a + \left(-5864.8025282699045 - t \cdot 15.234687407\right)}{{z}^{3}}\right) + \frac{-36.52704169880642}{z}\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(\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) \cdot \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z + 15.234687407, z, 31.4690115749\right), z, 11.9400905721\right), z, 0.607771387771\right)}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error0.7
Cost46536
\[\begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+33}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623 + \left(\frac{457.9610022158428}{z \cdot z} + \left(\left(\frac{t}{z \cdot z} + \frac{a + \left(-5864.8025282699045 - t \cdot 15.234687407\right)}{{z}^{3}}\right) + \frac{-36.52704169880642}{z}\right)\right), x\right)\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+16}:\\ \;\;\;\;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)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\mathsf{fma}\left(y, 3.13060547623, a \cdot \frac{y}{{z}^{3}}\right) + \frac{y}{z} \cdot \left(11.1667541262 + \frac{t}{z}\right)\right)\\ \end{array} \]
Alternative 2
Error2.1
Cost16196
\[\begin{array}{l} t_1 := \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)}\\ \mathbf{if}\;t_1 \leq 10^{+299}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-36.52704169880642, \frac{y}{z}, \mathsf{fma}\left(3.13060547623, y, x + \frac{y}{\frac{z \cdot z}{457.9610022158428 + t}}\right)\right)\\ \end{array} \]
Alternative 3
Error0.8
Cost14852
\[\begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+30}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623 + \left(\frac{457.9610022158428}{z \cdot z} + \left(\left(\frac{t}{z \cdot z} + \frac{a + \left(-5864.8025282699045 - t \cdot 15.234687407\right)}{{z}^{3}}\right) + \frac{-36.52704169880642}{z}\right)\right), x\right)\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+15}:\\ \;\;\;\;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)}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\mathsf{fma}\left(y, 3.13060547623, a \cdot \frac{y}{{z}^{3}}\right) + \frac{y}{z} \cdot \left(11.1667541262 + \frac{t}{z}\right)\right)\\ \end{array} \]
Alternative 4
Error0.8
Cost14345
\[\begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+30} \lor \neg \left(z \leq 4.8 \cdot 10^{+15}\right):\\ \;\;\;\;x + \left(\mathsf{fma}\left(y, 3.13060547623, a \cdot \frac{y}{{z}^{3}}\right) + \frac{y}{z} \cdot \left(11.1667541262 + \frac{t}{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 5
Error2.1
Cost9924
\[\begin{array}{l} t_1 := \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)}\\ \mathbf{if}\;t_1 \leq 10^{+299}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \left(\frac{t}{z \cdot z} + \left(3.13060547623 + \frac{457.9610022158428}{z \cdot z}\right)\right) + \frac{-36.52704169880642}{z}, x\right)\\ \end{array} \]
Alternative 6
Error2.1
Cost4676
\[\begin{array}{l} t_1 := \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)}\\ \mathbf{if}\;t_1 \leq 10^{+299}:\\ \;\;\;\;x + t_1\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot 3.13060547623 - \frac{y}{z} \cdot \left(-11.1667541262 - \frac{t}{z}\right)\right)\\ \end{array} \]
Alternative 7
Error3.1
Cost1225
\[\begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+30} \lor \neg \left(z \leq 1.7 \cdot 10^{-26}\right):\\ \;\;\;\;x + \left(y \cdot 3.13060547623 - \frac{y}{z} \cdot \left(-11.1667541262 - \frac{t}{z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot 1.6453555072203998\right) \cdot \left(b + z \cdot \left(a + z \cdot t\right)\right)\\ \end{array} \]
Alternative 8
Error4.2
Cost1224
\[\begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+30}:\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{elif}\;z \leq 400000:\\ \;\;\;\;x + \left(y \cdot 1.6453555072203998\right) \cdot \left(b + z \cdot \left(a + z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795 + \frac{3.7269864963038164}{z}}\\ \end{array} \]
Alternative 9
Error5.5
Cost968
\[\begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+31}:\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{elif}\;z \leq 380000:\\ \;\;\;\;x + 1.6453555072203998 \cdot \left(y \cdot \left(b + z \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795 + \frac{3.7269864963038164}{z}}\\ \end{array} \]
Alternative 10
Error9.3
Cost840
\[\begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+31}:\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-27}:\\ \;\;\;\;x + b \cdot \left(y \cdot 1.6453555072203998\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{0.31942702700572795 + \frac{3.7269864963038164}{z}}\\ \end{array} \]
Alternative 11
Error9.3
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+31} \lor \neg \left(z \leq 1.2 \cdot 10^{-27}\right):\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(y \cdot 1.6453555072203998\right)\\ \end{array} \]
Alternative 12
Error18.9
Cost585
\[\begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{-123} \lor \neg \left(z \leq 5.2 \cdot 10^{-68}\right):\\ \;\;\;\;x + y \cdot 3.13060547623\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 13
Error27.9
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-101}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-114}:\\ \;\;\;\;y \cdot 3.13060547623\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
Alternative 14
Error31.9
Cost64
\[x \]

Error

Reproduce

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