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

Percentage Accurate: 58.5% → 97.1%
Time: 45.7s
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.5% 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.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\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), \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)}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\mathsf{fma}\left(y, \frac{11.1667541262}{z}, \mathsf{fma}\left(y, 3.13060547623, t \cdot \frac{y}{z \cdot z}\right)\right) - \mathsf{fma}\left(y, \frac{47.69379582500642}{z}, \mathsf{fma}\left(y, \frac{98.5170599679272}{z \cdot z}, \frac{y \cdot -556.47806218377}{z \cdot z}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<=
      (/
       (*
        y
        (+
         (* z (+ (* z (+ (* z (+ (* z 3.13060547623) 11.1667541262)) t)) a))
         b))
       (+
        (*
         z
         (+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
        0.607771387771))
      INFINITY)
   (fma
    (fma z (fma z (fma z (fma z 3.13060547623 11.1667541262) t) a) b)
    (/
     y
     (fma
      z
      (fma z (fma z (+ z 15.234687407) 31.4690115749) 11.9400905721)
      0.607771387771))
    x)
   (+
    x
    (-
     (fma y (/ 11.1667541262 z) (fma y 3.13060547623 (* t (/ y (* z z)))))
     (fma
      y
      (/ 47.69379582500642 z)
      (fma
       y
       (/ 98.5170599679272 (* z z))
       (/ (* y -556.47806218377) (* z z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((y * ((z * ((z * ((z * ((z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= ((double) INFINITY)) {
		tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), (y / fma(z, fma(z, fma(z, (z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x);
	} else {
		tmp = x + (fma(y, (11.1667541262 / z), fma(y, 3.13060547623, (t * (y / (z * z))))) - fma(y, (47.69379582500642 / z), fma(y, (98.5170599679272 / (z * z)), ((y * -556.47806218377) / (z * z)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= Inf)
		tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), Float64(y / fma(z, fma(z, fma(z, Float64(z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x);
	else
		tmp = Float64(x + Float64(fma(y, Float64(11.1667541262 / z), fma(y, 3.13060547623, Float64(t * Float64(y / Float64(z * z))))) - fma(y, Float64(47.69379582500642 / z), fma(y, Float64(98.5170599679272 / Float64(z * z)), Float64(Float64(y * -556.47806218377) / Float64(z * z))))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * N[(z * N[(z * N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + b), $MachinePrecision] * N[(y / N[(z * N[(z * N[(z * N[(z + 15.234687407), $MachinePrecision] + 31.4690115749), $MachinePrecision] + 11.9400905721), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(N[(y * N[(11.1667541262 / z), $MachinePrecision] + N[(y * 3.13060547623 + N[(t * N[(y / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(47.69379582500642 / z), $MachinePrecision] + N[(y * N[(98.5170599679272 / N[(z * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y * -556.47806218377), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\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), \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)}, x\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(y, \frac{11.1667541262}{z}, \mathsf{fma}\left(y, 3.13060547623, t \cdot \frac{y}{z \cdot z}\right)\right) - \mathsf{fma}\left(y, \frac{47.69379582500642}{z}, \mathsf{fma}\left(y, \frac{98.5170599679272}{z \cdot z}, \frac{y \cdot -556.47806218377}{z \cdot z}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 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))) < +inf.0

    1. Initial program 91.6%

      \[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. Applied rewrites95.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\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), \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)}, x\right)} \]

    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 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 rewrites98.2%

      \[\leadsto x + \color{blue}{\left(\mathsf{fma}\left(y, \frac{11.1667541262}{z}, \mathsf{fma}\left(y, 3.13060547623, t \cdot \frac{y}{z \cdot z}\right)\right) - \mathsf{fma}\left(y, \frac{47.69379582500642}{z}, \mathsf{fma}\left(y, \frac{98.5170599679272}{z \cdot z}, \frac{y \cdot -556.47806218377}{z \cdot z}\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\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), \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)}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\mathsf{fma}\left(y, \frac{11.1667541262}{z}, \mathsf{fma}\left(y, 3.13060547623, t \cdot \frac{y}{z \cdot z}\right)\right) - \mathsf{fma}\left(y, \frac{47.69379582500642}{z}, \mathsf{fma}\left(y, \frac{98.5170599679272}{z \cdot z}, \frac{y \cdot -556.47806218377}{z \cdot z}\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 96.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\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), \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)}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<=
      (/
       (*
        y
        (+
         (* z (+ (* z (+ (* z (+ (* z 3.13060547623) 11.1667541262)) t)) a))
         b))
       (+
        (*
         z
         (+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
        0.607771387771))
      INFINITY)
   (fma
    (fma z (fma z (fma z (fma z 3.13060547623 11.1667541262) t) a) b)
    (/
     y
     (fma
      z
      (fma z (fma z (+ z 15.234687407) 31.4690115749) 11.9400905721)
      0.607771387771))
    x)
   (fma y 3.13060547623 x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((y * ((z * ((z * ((z * ((z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= ((double) INFINITY)) {
		tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), (y / fma(z, fma(z, fma(z, (z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x);
	} else {
		tmp = fma(y, 3.13060547623, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= Inf)
		tmp = fma(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b), Float64(y / fma(z, fma(z, fma(z, Float64(z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), x);
	else
		tmp = fma(y, 3.13060547623, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * N[(z * N[(z * N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + b), $MachinePrecision] * N[(y / N[(z * N[(z * N[(z * N[(z + 15.234687407), $MachinePrecision] + 31.4690115749), $MachinePrecision] + 11.9400905721), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\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), \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)}, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 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))) < +inf.0

    1. Initial program 91.6%

      \[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. Applied rewrites95.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\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), \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)}, x\right)} \]

    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. *-commutativeN/A

        \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
      3. lower-fma.f6494.7

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(\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), \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)}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;x + y \cdot \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 \cdot z, z \cdot z, 0.607771387771\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<=
      (/
       (*
        y
        (+
         (* z (+ (* z (+ (* z (+ (* z 3.13060547623) 11.1667541262)) t)) a))
         b))
       (+
        (*
         z
         (+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
        0.607771387771))
      INFINITY)
   (+
    x
    (*
     y
     (/
      (fma z (fma z (fma z (fma z 3.13060547623 11.1667541262) t) a) b)
      (fma (* z z) (* z z) 0.607771387771))))
   (fma y 3.13060547623 x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((y * ((z * ((z * ((z * ((z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= ((double) INFINITY)) {
		tmp = x + (y * (fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b) / fma((z * z), (z * z), 0.607771387771)));
	} else {
		tmp = fma(y, 3.13060547623, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(Float64(y * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * 3.13060547623) + 11.1667541262)) + t)) + a)) + b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)) <= Inf)
		tmp = Float64(x + Float64(y * Float64(fma(z, fma(z, fma(z, fma(z, 3.13060547623, 11.1667541262), t), a), b) / fma(Float64(z * z), Float64(z * z), 0.607771387771))));
	else
		tmp = fma(y, 3.13060547623, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(N[(z * N[(N[(z * N[(N[(z * 3.13060547623), $MachinePrecision] + 11.1667541262), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision], Infinity], N[(x + N[(y * N[(N[(z * N[(z * N[(z * N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + b), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z * z), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\
\;\;\;\;x + y \cdot \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 \cdot z, z \cdot z, 0.607771387771\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 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))) < +inf.0

    1. Initial program 91.6%

      \[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{y \cdot \left(\left(\left(\left(\color{blue}{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 \left(\left(\left(\color{blue}{\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. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\left(\color{blue}{\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}} \]
      4. lift-+.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\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}} \]
      5. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\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}} \]
      6. lift-+.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\color{blue}{\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}} \]
      7. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\color{blue}{\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}} \]
      8. 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}} \]
      9. div-subN/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\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)}{\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z - b} - \frac{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}\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}} \]
    4. Applied rewrites60.8%

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

      \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{{z}^{3}} \cdot z + \frac{607771387771}{1000000000000}} \]
    6. Step-by-step derivation
      1. cube-multN/A

        \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{\left(z \cdot \left(z \cdot z\right)\right)} \cdot z + \frac{607771387771}{1000000000000}} \]
      2. unpow2N/A

        \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\left(z \cdot \color{blue}{{z}^{2}}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
      3. lower-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{\left(z \cdot {z}^{2}\right)} \cdot z + \frac{607771387771}{1000000000000}} \]
      4. unpow2N/A

        \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\left(z \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
      5. lower-*.f6460.5

        \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b} + \left(-\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b}\right)\right)}{\left(z \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot z + 0.607771387771} \]
    7. Applied rewrites60.5%

      \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b} + \left(-\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b}\right)\right)}{\color{blue}{\left(z \cdot \left(z \cdot z\right)\right)} \cdot z + 0.607771387771} \]
    8. Applied rewrites93.2%

      \[\leadsto x + \color{blue}{\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 \cdot z, z \cdot z, 0.607771387771\right)} \cdot y} \]

    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. *-commutativeN/A

        \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
      3. lower-fma.f6494.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z \cdot \left(z \cdot \left(z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right) + t\right) + a\right) + b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771} \leq \infty:\\ \;\;\;\;x + y \cdot \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 \cdot z, z \cdot z, 0.607771387771\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 94.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+185}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right) + \frac{\frac{\mathsf{fma}\left(y, t, \mathsf{fma}\left(y, -98.5170599679272, y \cdot 556.47806218377\right)\right)}{z} - y \cdot 36.52704169880642}{z}\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, t, a\right), b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -1.3e+185)
   (fma y 3.13060547623 x)
   (if (<= z -7.2e+22)
     (+
      (fma y 3.13060547623 x)
      (/
       (-
        (/ (fma y t (fma y -98.5170599679272 (* y 556.47806218377))) z)
        (* y 36.52704169880642))
       z))
     (if (<= z 6.6e+18)
       (+
        x
        (/
         (* y (fma z (fma z t a) b))
         (+
          (*
           z
           (+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
          0.607771387771)))
       (fma y 3.13060547623 x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.3e+185) {
		tmp = fma(y, 3.13060547623, x);
	} else if (z <= -7.2e+22) {
		tmp = fma(y, 3.13060547623, x) + (((fma(y, t, fma(y, -98.5170599679272, (y * 556.47806218377))) / z) - (y * 36.52704169880642)) / z);
	} else if (z <= 6.6e+18) {
		tmp = x + ((y * fma(z, fma(z, t, a), b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771));
	} else {
		tmp = fma(y, 3.13060547623, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1.3e+185)
		tmp = fma(y, 3.13060547623, x);
	elseif (z <= -7.2e+22)
		tmp = Float64(fma(y, 3.13060547623, x) + Float64(Float64(Float64(fma(y, t, fma(y, -98.5170599679272, Float64(y * 556.47806218377))) / z) - Float64(y * 36.52704169880642)) / z));
	elseif (z <= 6.6e+18)
		tmp = Float64(x + Float64(Float64(y * fma(z, fma(z, t, a), b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)));
	else
		tmp = fma(y, 3.13060547623, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.3e+185], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, -7.2e+22], N[(N[(y * 3.13060547623 + x), $MachinePrecision] + N[(N[(N[(N[(y * t + N[(y * -98.5170599679272 + N[(y * 556.47806218377), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - N[(y * 36.52704169880642), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+18], N[(x + N[(N[(y * N[(z * N[(z * t + a), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\

\mathbf{elif}\;z \leq -7.2 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right) + \frac{\frac{\mathsf{fma}\left(y, t, \mathsf{fma}\left(y, -98.5170599679272, y \cdot 556.47806218377\right)\right)}{z} - y \cdot 36.52704169880642}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3e185 or 6.6e18 < z

    1. Initial program 7.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 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. *-commutativeN/A

        \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
      3. lower-fma.f6491.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

    if -1.3e185 < z < -7.2e22

    1. Initial program 19.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 z around -inf

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

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

    if -7.2e22 < z < 6.6e18

    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 0

      \[\leadsto x + \frac{y \cdot \color{blue}{\left(b + z \cdot \left(a + t \cdot z\right)\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}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(z \cdot \left(a + t \cdot z\right) + 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. lower-fma.f64N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\mathsf{fma}\left(z, a + t \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. +-commutativeN/A

        \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, \color{blue}{t \cdot z + a}, 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}} \]
      4. *-commutativeN/A

        \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, \color{blue}{z \cdot t} + a, 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}} \]
      5. lower-fma.f6499.7

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

      \[\leadsto x + \frac{y \cdot \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, t, a\right), 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 3 regimes into one program.
  4. Final simplification95.6%

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

Alternative 5: 94.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+54}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, t, a\right), b\right)}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -4.2e+54)
   (fma y 3.13060547623 x)
   (if (<= z 6.6e+18)
     (+
      x
      (/
       (* y (fma z (fma z t a) b))
       (+
        (*
         z
         (+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
        0.607771387771)))
     (fma y 3.13060547623 x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -4.2e+54) {
		tmp = fma(y, 3.13060547623, x);
	} else if (z <= 6.6e+18) {
		tmp = x + ((y * fma(z, fma(z, t, a), b)) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771));
	} else {
		tmp = fma(y, 3.13060547623, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -4.2e+54)
		tmp = fma(y, 3.13060547623, x);
	elseif (z <= 6.6e+18)
		tmp = Float64(x + Float64(Float64(y * fma(z, fma(z, t, a), b)) / Float64(Float64(z * Float64(Float64(z * Float64(Float64(z * Float64(z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)));
	else
		tmp = fma(y, 3.13060547623, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e+54], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 6.6e+18], N[(x + N[(N[(y * N[(z * N[(z * t + a), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(N[(z * N[(N[(z * N[(z + 15.234687407), $MachinePrecision]), $MachinePrecision] + 31.4690115749), $MachinePrecision]), $MachinePrecision] + 11.9400905721), $MachinePrecision]), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.19999999999999972e54 or 6.6e18 < z

    1. Initial program 6.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. 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. *-commutativeN/A

        \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
      3. lower-fma.f6490.4

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

    if -4.19999999999999972e54 < z < 6.6e18

    1. Initial program 99.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 0

      \[\leadsto x + \frac{y \cdot \color{blue}{\left(b + z \cdot \left(a + t \cdot z\right)\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}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(z \cdot \left(a + t \cdot z\right) + 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. lower-fma.f64N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\mathsf{fma}\left(z, a + t \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. +-commutativeN/A

        \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, \color{blue}{t \cdot z + a}, 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}} \]
      4. *-commutativeN/A

        \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, \color{blue}{z \cdot t} + a, 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}} \]
      5. lower-fma.f6497.1

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

      \[\leadsto x + \frac{y \cdot \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, t, a\right), 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 simplification93.9%

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

Alternative 6: 92.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot \left(a + z \cdot \left(t + z \cdot \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right)\right)\right)\right)}{0.607771387771}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -1.02e+22)
   (fma y 3.13060547623 x)
   (if (<= z 4.5e+18)
     (+
      x
      (/
       (*
        y
        (+
         b
         (* z (+ a (* z (+ t (* z (fma z 3.13060547623 11.1667541262))))))))
       0.607771387771))
     (fma y 3.13060547623 x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.02e+22) {
		tmp = fma(y, 3.13060547623, x);
	} else if (z <= 4.5e+18) {
		tmp = x + ((y * (b + (z * (a + (z * (t + (z * fma(z, 3.13060547623, 11.1667541262)))))))) / 0.607771387771);
	} else {
		tmp = fma(y, 3.13060547623, x);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1.02e+22)
		tmp = fma(y, 3.13060547623, x);
	elseif (z <= 4.5e+18)
		tmp = Float64(x + Float64(Float64(y * Float64(b + Float64(z * Float64(a + Float64(z * Float64(t + Float64(z * fma(z, 3.13060547623, 11.1667541262)))))))) / 0.607771387771));
	else
		tmp = fma(y, 3.13060547623, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.02e+22], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 4.5e+18], N[(x + N[(N[(y * N[(b + N[(z * N[(a + N[(z * N[(t + N[(z * N[(z * 3.13060547623 + 11.1667541262), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 0.607771387771), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y \cdot \left(b + z \cdot \left(a + z \cdot \left(t + z \cdot \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right)\right)\right)\right)}{0.607771387771}\\

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


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

    1. Initial program 11.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. 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. *-commutativeN/A

        \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
      3. lower-fma.f6488.1

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

    if -1.02e22 < z < 4.5e18

    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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\left(\left(\color{blue}{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 \left(\left(\left(\color{blue}{\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. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\left(\color{blue}{\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}} \]
      4. lift-+.f6499.7

        \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\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} \]
      5. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\left(\color{blue}{\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}} \]
      6. *-commutativeN/A

        \[\leadsto x + \frac{y \cdot \left(\left(\left(\color{blue}{z \cdot \left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right)} + 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}} \]
      7. lower-*.f6499.7

        \[\leadsto x + \frac{y \cdot \left(\left(\left(\color{blue}{z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right)} + 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} \]
      8. lift-+.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\left(z \cdot \color{blue}{\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right)} + 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}} \]
      9. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\left(z \cdot \left(\color{blue}{z \cdot \frac{313060547623}{100000000000}} + \frac{55833770631}{5000000000}\right) + 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}} \]
      10. lower-fma.f6499.7

        \[\leadsto x + \frac{y \cdot \left(\left(\left(z \cdot \color{blue}{\mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right)} + 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} \]
    4. Applied rewrites99.7%

      \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\left(z \cdot \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right) + 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} \]
    5. Taylor expanded in z around 0

      \[\leadsto x + \frac{y \cdot \left(\left(\left(z \cdot \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right) + t\right) \cdot z + a\right) \cdot z + b\right)}{\color{blue}{\frac{607771387771}{1000000000000}}} \]
    6. Step-by-step derivation
      1. Applied rewrites94.9%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+18}:\\ \;\;\;\;x + \frac{y \cdot \left(b + z \cdot \left(a + z \cdot \left(t + z \cdot \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right)\right)\right)\right)}{0.607771387771}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 7: 91.3% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+23}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+44}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(z, a, 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)}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(3.13060547623, y, \frac{y \cdot 11.1667541262}{z}\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= z -1.35e+23)
       (fma y 3.13060547623 x)
       (if (<= z 2.35e+44)
         (fma
          (/
           (fma z a b)
           (fma
            z
            (fma z (fma z (+ z 15.234687407) 31.4690115749) 11.9400905721)
            0.607771387771))
          y
          x)
         (+ x (fma 3.13060547623 y (/ (* y 11.1667541262) z))))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -1.35e+23) {
    		tmp = fma(y, 3.13060547623, x);
    	} else if (z <= 2.35e+44) {
    		tmp = fma((fma(z, a, b) / fma(z, fma(z, fma(z, (z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), y, x);
    	} else {
    		tmp = x + fma(3.13060547623, y, ((y * 11.1667541262) / z));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (z <= -1.35e+23)
    		tmp = fma(y, 3.13060547623, x);
    	elseif (z <= 2.35e+44)
    		tmp = fma(Float64(fma(z, a, b) / fma(z, fma(z, fma(z, Float64(z + 15.234687407), 31.4690115749), 11.9400905721), 0.607771387771)), y, x);
    	else
    		tmp = Float64(x + fma(3.13060547623, y, Float64(Float64(y * 11.1667541262) / z)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.35e+23], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 2.35e+44], N[(N[(N[(z * a + b), $MachinePrecision] / N[(z * N[(z * N[(z * N[(z + 15.234687407), $MachinePrecision] + 31.4690115749), $MachinePrecision] + 11.9400905721), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision], N[(x + N[(3.13060547623 * y + N[(N[(y * 11.1667541262), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -1.35 \cdot 10^{+23}:\\
    \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
    
    \mathbf{elif}\;z \leq 2.35 \cdot 10^{+44}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(z, a, 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)}, y, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x + \mathsf{fma}\left(3.13060547623, y, \frac{y \cdot 11.1667541262}{z}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -1.3499999999999999e23

      1. Initial program 12.6%

        \[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. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
        3. lower-fma.f6488.3

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

      if -1.3499999999999999e23 < z < 2.35000000000000009e44

      1. Initial program 96.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. Taylor expanded in z around 0

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(b + a \cdot z\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}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(a \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. *-commutativeN/A

          \[\leadsto x + \frac{y \cdot \left(\color{blue}{z \cdot a} + 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. lower-fma.f6488.9

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\mathsf{fma}\left(z, a, b\right)}}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771} \]
      6. Step-by-step derivation
        1. lift-fma.f64N/A

          \[\leadsto x + \frac{y \cdot \color{blue}{\mathsf{fma}\left(z, a, 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{\color{blue}{y \cdot \mathsf{fma}\left(z, a, 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. lift-+.f64N/A

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

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

          \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\left(\color{blue}{\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. lift-*.f64N/A

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

          \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\color{blue}{\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}} \]
        8. lift-*.f64N/A

          \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\color{blue}{\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}} \]
        9. lift-+.f64N/A

          \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\color{blue}{\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}}} \]
        10. lift-/.f64N/A

          \[\leadsto x + \color{blue}{\frac{y \cdot \mathsf{fma}\left(z, a, 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}}} \]
        11. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{y \cdot \mathsf{fma}\left(z, a, 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}} + x} \]
      7. Applied rewrites91.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(z, a, 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)}, y, x\right)} \]

      if 2.35000000000000009e44 < z

      1. Initial program 8.6%

        \[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{y \cdot \left(\left(\left(\left(\color{blue}{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 \left(\left(\left(\color{blue}{\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. lift-*.f64N/A

          \[\leadsto x + \frac{y \cdot \left(\left(\left(\color{blue}{\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}} \]
        4. lift-+.f64N/A

          \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\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}} \]
        5. lift-*.f64N/A

          \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\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}} \]
        6. lift-+.f64N/A

          \[\leadsto x + \frac{y \cdot \left(\color{blue}{\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}} \]
        7. lift-*.f64N/A

          \[\leadsto x + \frac{y \cdot \left(\color{blue}{\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}} \]
        8. 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}} \]
        9. div-subN/A

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(\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)}{\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z - b} - \frac{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}\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}} \]
      4. Applied rewrites0.1%

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

        \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{{z}^{3}} \cdot z + \frac{607771387771}{1000000000000}} \]
      6. Step-by-step derivation
        1. cube-multN/A

          \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{\left(z \cdot \left(z \cdot z\right)\right)} \cdot z + \frac{607771387771}{1000000000000}} \]
        2. unpow2N/A

          \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\left(z \cdot \color{blue}{{z}^{2}}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
        3. lower-*.f64N/A

          \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{\left(z \cdot {z}^{2}\right)} \cdot z + \frac{607771387771}{1000000000000}} \]
        4. unpow2N/A

          \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\left(z \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
        5. lower-*.f640.1

          \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b} + \left(-\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b}\right)\right)}{\left(z \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot z + 0.607771387771} \]
      7. Applied rewrites0.1%

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

        \[\leadsto x + \color{blue}{\left(\frac{313060547623}{100000000000} \cdot y + \frac{55833770631}{5000000000} \cdot \frac{y}{z}\right)} \]
      9. Step-by-step derivation
        1. lower-fma.f64N/A

          \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{313060547623}{100000000000}, y, \frac{55833770631}{5000000000} \cdot \frac{y}{z}\right)} \]
        2. associate-*r/N/A

          \[\leadsto x + \mathsf{fma}\left(\frac{313060547623}{100000000000}, y, \color{blue}{\frac{\frac{55833770631}{5000000000} \cdot y}{z}}\right) \]
        3. lower-/.f64N/A

          \[\leadsto x + \mathsf{fma}\left(\frac{313060547623}{100000000000}, y, \color{blue}{\frac{\frac{55833770631}{5000000000} \cdot y}{z}}\right) \]
        4. lower-*.f6492.5

          \[\leadsto x + \mathsf{fma}\left(3.13060547623, y, \frac{\color{blue}{11.1667541262 \cdot y}}{z}\right) \]
      10. Applied rewrites92.5%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(3.13060547623, y, \frac{11.1667541262 \cdot y}{z}\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification90.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+23}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+44}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(z, a, 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)}, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(3.13060547623, y, \frac{y \cdot 11.1667541262}{z}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 90.1% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+14}:\\ \;\;\;\;x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 31.4690115749, 11.9400905721\right), 0.607771387771\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= z -8.2e+21)
       (fma y 3.13060547623 x)
       (if (<= z 5e+14)
         (+
          x
          (/
           (* y (fma z a b))
           (fma z (fma z 31.4690115749 11.9400905721) 0.607771387771)))
         (fma y 3.13060547623 x))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -8.2e+21) {
    		tmp = fma(y, 3.13060547623, x);
    	} else if (z <= 5e+14) {
    		tmp = x + ((y * fma(z, a, b)) / fma(z, fma(z, 31.4690115749, 11.9400905721), 0.607771387771));
    	} else {
    		tmp = fma(y, 3.13060547623, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (z <= -8.2e+21)
    		tmp = fma(y, 3.13060547623, x);
    	elseif (z <= 5e+14)
    		tmp = Float64(x + Float64(Float64(y * fma(z, a, b)) / fma(z, fma(z, 31.4690115749, 11.9400905721), 0.607771387771)));
    	else
    		tmp = fma(y, 3.13060547623, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e+21], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 5e+14], N[(x + N[(N[(y * N[(z * a + b), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z * 31.4690115749 + 11.9400905721), $MachinePrecision] + 0.607771387771), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\
    \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
    
    \mathbf{elif}\;z \leq 5 \cdot 10^{+14}:\\
    \;\;\;\;x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 31.4690115749, 11.9400905721\right), 0.607771387771\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -8.2e21 or 5e14 < z

      1. Initial program 11.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. 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. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
        3. lower-fma.f6488.1

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

      if -8.2e21 < z < 5e14

      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 0

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(b + a \cdot z\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}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(a \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. *-commutativeN/A

          \[\leadsto x + \frac{y \cdot \left(\color{blue}{z \cdot a} + 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. lower-fma.f6493.0

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

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

        \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\color{blue}{\frac{607771387771}{1000000000000} + z \cdot \left(\frac{119400905721}{10000000000} + \frac{314690115749}{10000000000} \cdot z\right)}} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

          \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\mathsf{fma}\left(z, \color{blue}{z \cdot \frac{314690115749}{10000000000}} + \frac{119400905721}{10000000000}, \frac{607771387771}{1000000000000}\right)} \]
        5. lower-fma.f6489.7

          \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 31.4690115749, 11.9400905721\right)}, 0.607771387771\right)} \]
      8. Applied rewrites89.7%

        \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 31.4690115749, 11.9400905721\right), 0.607771387771\right)}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 89.7% accurate, 1.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 2400000000000:\\ \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(1.6453555072203998, b, z \cdot \mathsf{fma}\left(1.6453555072203998, a, b \cdot -32.324150453290734\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= z -8.2e+21)
       (fma y 3.13060547623 x)
       (if (<= z 2400000000000.0)
         (fma
          y
          (fma
           1.6453555072203998
           b
           (* z (fma 1.6453555072203998 a (* b -32.324150453290734))))
          x)
         (fma y 3.13060547623 x))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -8.2e+21) {
    		tmp = fma(y, 3.13060547623, x);
    	} else if (z <= 2400000000000.0) {
    		tmp = fma(y, fma(1.6453555072203998, b, (z * fma(1.6453555072203998, a, (b * -32.324150453290734)))), x);
    	} else {
    		tmp = fma(y, 3.13060547623, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (z <= -8.2e+21)
    		tmp = fma(y, 3.13060547623, x);
    	elseif (z <= 2400000000000.0)
    		tmp = fma(y, fma(1.6453555072203998, b, Float64(z * fma(1.6453555072203998, a, Float64(b * -32.324150453290734)))), x);
    	else
    		tmp = fma(y, 3.13060547623, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e+21], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 2400000000000.0], N[(y * N[(1.6453555072203998 * b + N[(z * N[(1.6453555072203998 * a + N[(b * -32.324150453290734), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\
    \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
    
    \mathbf{elif}\;z \leq 2400000000000:\\
    \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(1.6453555072203998, b, z \cdot \mathsf{fma}\left(1.6453555072203998, a, b \cdot -32.324150453290734\right)\right), x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -8.2e21 or 2.4e12 < z

      1. Initial program 11.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. 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. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
        3. lower-fma.f6488.1

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

      if -8.2e21 < z < 2.4e12

      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 0

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(b + a \cdot z\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}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(a \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. *-commutativeN/A

          \[\leadsto x + \frac{y \cdot \left(\color{blue}{z \cdot a} + 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. lower-fma.f6493.0

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

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

        \[\leadsto \color{blue}{x + y \cdot \left(\frac{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)} + \frac{a \cdot z}{\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)}\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \left(\frac{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)} + \frac{a \cdot z}{\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)}\right) + x} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{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)} + \frac{a \cdot z}{\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)}, x\right)} \]
      8. Applied rewrites93.0%

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1000000000000}{607771387771} \cdot b + z \cdot \left(\frac{1000000000000}{607771387771} \cdot a - \frac{11940090572100000000000000}{369386059793087248348441} \cdot b\right)}, x\right) \]
      10. Step-by-step derivation
        1. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(\frac{1000000000000}{607771387771}, b, z \cdot \left(\frac{1000000000000}{607771387771} \cdot a - \frac{11940090572100000000000000}{369386059793087248348441} \cdot b\right)\right)}, x\right) \]
        2. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1000000000000}{607771387771}, b, \color{blue}{z \cdot \left(\frac{1000000000000}{607771387771} \cdot a - \frac{11940090572100000000000000}{369386059793087248348441} \cdot b\right)}\right), x\right) \]
        3. cancel-sign-sub-invN/A

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

          \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1000000000000}{607771387771}, b, z \cdot \color{blue}{\mathsf{fma}\left(\frac{1000000000000}{607771387771}, a, \left(\mathsf{neg}\left(\frac{11940090572100000000000000}{369386059793087248348441}\right)\right) \cdot b\right)}\right), x\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1000000000000}{607771387771}, b, z \cdot \mathsf{fma}\left(\frac{1000000000000}{607771387771}, a, \color{blue}{\frac{-11940090572100000000000000}{369386059793087248348441}} \cdot b\right)\right), x\right) \]
        6. lower-*.f6489.6

          \[\leadsto \mathsf{fma}\left(y, \mathsf{fma}\left(1.6453555072203998, b, z \cdot \mathsf{fma}\left(1.6453555072203998, a, \color{blue}{-32.324150453290734 \cdot b}\right)\right), x\right) \]
      11. Applied rewrites89.6%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(1.6453555072203998, b, z \cdot \mathsf{fma}\left(1.6453555072203998, a, -32.324150453290734 \cdot b\right)\right)}, x\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification88.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 2400000000000:\\ \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(1.6453555072203998, b, z \cdot \mathsf{fma}\left(1.6453555072203998, a, b \cdot -32.324150453290734\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 89.8% accurate, 2.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+14}:\\ \;\;\;\;x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{0.607771387771}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (<= z -8.2e+21)
       (fma y 3.13060547623 x)
       (if (<= z 1.7e+14)
         (+ x (/ (* y (fma z a b)) 0.607771387771))
         (fma y 3.13060547623 x))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (z <= -8.2e+21) {
    		tmp = fma(y, 3.13060547623, x);
    	} else if (z <= 1.7e+14) {
    		tmp = x + ((y * fma(z, a, b)) / 0.607771387771);
    	} else {
    		tmp = fma(y, 3.13060547623, x);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if (z <= -8.2e+21)
    		tmp = fma(y, 3.13060547623, x);
    	elseif (z <= 1.7e+14)
    		tmp = Float64(x + Float64(Float64(y * fma(z, a, b)) / 0.607771387771));
    	else
    		tmp = fma(y, 3.13060547623, x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e+21], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 1.7e+14], N[(x + N[(N[(y * N[(z * a + b), $MachinePrecision]), $MachinePrecision] / 0.607771387771), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\
    \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
    
    \mathbf{elif}\;z \leq 1.7 \cdot 10^{+14}:\\
    \;\;\;\;x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{0.607771387771}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -8.2e21 or 1.7e14 < z

      1. Initial program 11.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. 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. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
        3. lower-fma.f6488.1

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

      if -8.2e21 < z < 1.7e14

      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 0

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(b + a \cdot z\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}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(a \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. *-commutativeN/A

          \[\leadsto x + \frac{y \cdot \left(\color{blue}{z \cdot a} + 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. lower-fma.f6493.0

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

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

        \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\color{blue}{\frac{607771387771}{1000000000000}}} \]
      7. Step-by-step derivation
        1. Applied rewrites89.5%

          \[\leadsto x + \frac{y \cdot \mathsf{fma}\left(z, a, b\right)}{\color{blue}{0.607771387771}} \]
      8. Recombined 2 regimes into one program.
      9. Add Preprocessing

      Alternative 11: 89.3% accurate, 2.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+14}:\\ \;\;\;\;x + 1.6453555072203998 \cdot \mathsf{fma}\left(a, y \cdot z, y \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= z -8e+21)
         (fma y 3.13060547623 x)
         (if (<= z 1.7e+14)
           (+ x (* 1.6453555072203998 (fma a (* y z) (* y b))))
           (fma y 3.13060547623 x))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (z <= -8e+21) {
      		tmp = fma(y, 3.13060547623, x);
      	} else if (z <= 1.7e+14) {
      		tmp = x + (1.6453555072203998 * fma(a, (y * z), (y * b)));
      	} else {
      		tmp = fma(y, 3.13060547623, x);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (z <= -8e+21)
      		tmp = fma(y, 3.13060547623, x);
      	elseif (z <= 1.7e+14)
      		tmp = Float64(x + Float64(1.6453555072203998 * fma(a, Float64(y * z), Float64(y * b))));
      	else
      		tmp = fma(y, 3.13060547623, x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8e+21], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 1.7e+14], N[(x + N[(1.6453555072203998 * N[(a * N[(y * z), $MachinePrecision] + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -8 \cdot 10^{+21}:\\
      \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
      
      \mathbf{elif}\;z \leq 1.7 \cdot 10^{+14}:\\
      \;\;\;\;x + 1.6453555072203998 \cdot \mathsf{fma}\left(a, y \cdot z, y \cdot b\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -8e21 or 1.7e14 < z

        1. Initial program 11.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. 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. *-commutativeN/A

            \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
          3. lower-fma.f6488.1

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

        if -8e21 < z < 1.7e14

        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. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto x + \frac{y \cdot \left(\left(\left(\left(\color{blue}{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 \left(\left(\left(\color{blue}{\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. lift-*.f64N/A

            \[\leadsto x + \frac{y \cdot \left(\left(\left(\color{blue}{\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}} \]
          4. lift-+.f64N/A

            \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\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}} \]
          5. lift-*.f64N/A

            \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{\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}} \]
          6. lift-+.f64N/A

            \[\leadsto x + \frac{y \cdot \left(\color{blue}{\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}} \]
          7. lift-*.f64N/A

            \[\leadsto x + \frac{y \cdot \left(\color{blue}{\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}} \]
          8. 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}} \]
          9. div-subN/A

            \[\leadsto x + \frac{y \cdot \color{blue}{\left(\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)}{\left(\left(\left(z \cdot \frac{313060547623}{100000000000} + \frac{55833770631}{5000000000}\right) \cdot z + t\right) \cdot z + a\right) \cdot z - b} - \frac{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}\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}} \]
        4. Applied rewrites70.5%

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

          \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{{z}^{3}} \cdot z + \frac{607771387771}{1000000000000}} \]
        6. Step-by-step derivation
          1. cube-multN/A

            \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{\left(z \cdot \left(z \cdot z\right)\right)} \cdot z + \frac{607771387771}{1000000000000}} \]
          2. unpow2N/A

            \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\left(z \cdot \color{blue}{{z}^{2}}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
          3. lower-*.f64N/A

            \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\color{blue}{\left(z \cdot {z}^{2}\right)} \cdot z + \frac{607771387771}{1000000000000}} \]
          4. unpow2N/A

            \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b} + \left(\mathsf{neg}\left(\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{313060547623}{100000000000}, \frac{55833770631}{5000000000}\right), t\right), a\right) - b}\right)\right)\right)}{\left(z \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot z + \frac{607771387771}{1000000000000}} \]
          5. lower-*.f6470.0

            \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b} + \left(-\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b}\right)\right)}{\left(z \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot z + 0.607771387771} \]
        7. Applied rewrites70.0%

          \[\leadsto x + \frac{y \cdot \left(\frac{\left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right) \cdot \left(z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right)\right)}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b} + \left(-\frac{b \cdot b}{z \cdot \mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 3.13060547623, 11.1667541262\right), t\right), a\right) - b}\right)\right)}{\color{blue}{\left(z \cdot \left(z \cdot z\right)\right)} \cdot z + 0.607771387771} \]
        8. Taylor expanded in z around 0

          \[\leadsto x + \color{blue}{\left(\frac{1000000000000}{607771387771} \cdot \left(a \cdot \left(y \cdot z\right)\right) + \frac{1000000000000}{607771387771} \cdot \left(b \cdot y\right)\right)} \]
        9. Step-by-step derivation
          1. distribute-lft-outN/A

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

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

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

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

            \[\leadsto x + 1.6453555072203998 \cdot \mathsf{fma}\left(a, y \cdot z, \color{blue}{b \cdot y}\right) \]
        10. Applied rewrites86.8%

          \[\leadsto x + \color{blue}{1.6453555072203998 \cdot \mathsf{fma}\left(a, y \cdot z, b \cdot y\right)} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification87.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+14}:\\ \;\;\;\;x + 1.6453555072203998 \cdot \mathsf{fma}\left(a, y \cdot z, y \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 12: 83.1% accurate, 3.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-11}:\\ \;\;\;\;\mathsf{fma}\left(1.6453555072203998, y \cdot b, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= z -8.2e+21)
         (fma y 3.13060547623 x)
         (if (<= z 8e-11)
           (fma 1.6453555072203998 (* y b) x)
           (fma y 3.13060547623 x))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (z <= -8.2e+21) {
      		tmp = fma(y, 3.13060547623, x);
      	} else if (z <= 8e-11) {
      		tmp = fma(1.6453555072203998, (y * b), x);
      	} else {
      		tmp = fma(y, 3.13060547623, x);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (z <= -8.2e+21)
      		tmp = fma(y, 3.13060547623, x);
      	elseif (z <= 8e-11)
      		tmp = fma(1.6453555072203998, Float64(y * b), x);
      	else
      		tmp = fma(y, 3.13060547623, x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.2e+21], N[(y * 3.13060547623 + x), $MachinePrecision], If[LessEqual[z, 8e-11], N[(1.6453555072203998 * N[(y * b), $MachinePrecision] + x), $MachinePrecision], N[(y * 3.13060547623 + x), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -8.2 \cdot 10^{+21}:\\
      \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
      
      \mathbf{elif}\;z \leq 8 \cdot 10^{-11}:\\
      \;\;\;\;\mathsf{fma}\left(1.6453555072203998, y \cdot b, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(y, 3.13060547623, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -8.2e21 or 7.99999999999999952e-11 < z

        1. Initial program 15.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. *-commutativeN/A

            \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
          3. lower-fma.f6486.4

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]

        if -8.2e21 < z < 7.99999999999999952e-11

        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 0

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(b + a \cdot z\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}} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x + \frac{y \cdot \color{blue}{\left(a \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. *-commutativeN/A

            \[\leadsto x + \frac{y \cdot \left(\color{blue}{z \cdot a} + 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. lower-fma.f6493.4

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(1.6453555072203998, y \cdot b, x\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 13: 62.5% accurate, 11.3× speedup?

      \[\begin{array}{l} \\ \mathsf{fma}\left(y, 3.13060547623, x\right) \end{array} \]
      (FPCore (x y z t a b) :precision binary64 (fma y 3.13060547623 x))
      double code(double x, double y, double z, double t, double a, double b) {
      	return fma(y, 3.13060547623, x);
      }
      
      function code(x, y, z, t, a, b)
      	return fma(y, 3.13060547623, x)
      end
      
      code[x_, y_, z_, t_, a_, b_] := N[(y * 3.13060547623 + x), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \mathsf{fma}\left(y, 3.13060547623, x\right)
      \end{array}
      
      Derivation
      1. Initial program 54.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. 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. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
        3. lower-fma.f6463.3

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 3.13060547623, x\right)} \]
      6. Add Preprocessing

      Alternative 14: 21.8% accurate, 13.2× speedup?

      \[\begin{array}{l} \\ y \cdot 3.13060547623 \end{array} \]
      (FPCore (x y z t a b) :precision binary64 (* y 3.13060547623))
      double code(double x, double y, double z, double t, double a, double b) {
      	return y * 3.13060547623;
      }
      
      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 = y * 3.13060547623d0
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	return y * 3.13060547623;
      }
      
      def code(x, y, z, t, a, b):
      	return y * 3.13060547623
      
      function code(x, y, z, t, a, b)
      	return Float64(y * 3.13060547623)
      end
      
      function tmp = code(x, y, z, t, a, b)
      	tmp = y * 3.13060547623;
      end
      
      code[x_, y_, z_, t_, a_, b_] := N[(y * 3.13060547623), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      y \cdot 3.13060547623
      \end{array}
      
      Derivation
      1. Initial program 54.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. 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. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} + x \]
        3. lower-fma.f6463.3

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

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

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

          \[\leadsto \color{blue}{y \cdot \frac{313060547623}{100000000000}} \]
        2. lower-*.f6421.6

          \[\leadsto \color{blue}{y \cdot 3.13060547623} \]
      8. Applied rewrites21.6%

        \[\leadsto \color{blue}{y \cdot 3.13060547623} \]
      9. 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 2024220 
      (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))))