Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2

Percentage Accurate: 55.5% → 83.0%
Time: 23.8s
Alternatives: 15
Speedup: 1.9×

Specification

?
\[\begin{array}{l} \\ \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (/
  (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t)
  (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i):
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\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 15 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: 55.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (/
  (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t)
  (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    code = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i):
	return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
\end{array}

Alternative 1: 83.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+48}:\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+48}:\\ \;\;\;\;\frac{t}{t\_1} + \frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ i (* y (+ c (* y (+ b (* y (+ y a)))))))))
   (if (<= y -2.4e+48)
     (- (+ x (/ z y)) (/ (* x a) y))
     (if (<= y 1.65e+48)
       (+
        (/ t t_1)
        (/
         (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y (+ z (* y x)))))))
         t_1))
       (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = i + (y * (c + (y * (b + (y * (y + a))))));
	double tmp;
	if (y <= -2.4e+48) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else if (y <= 1.65e+48) {
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1);
	} else {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = i + (y * (c + (y * (b + (y * (y + a))))))
    if (y <= (-2.4d+48)) then
        tmp = (x + (z / y)) - ((x * a) / y)
    else if (y <= 1.65d+48) then
        tmp = (t / t_1) + ((y * (230661.510616d0 + (y * (27464.7644705d0 + (y * (z + (y * x))))))) / t_1)
    else
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = i + (y * (c + (y * (b + (y * (y + a))))));
	double tmp;
	if (y <= -2.4e+48) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else if (y <= 1.65e+48) {
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1);
	} else {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = i + (y * (c + (y * (b + (y * (y + a))))))
	tmp = 0
	if y <= -2.4e+48:
		tmp = (x + (z / y)) - ((x * a) / y)
	elif y <= 1.65e+48:
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1)
	else:
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(i + Float64(y * Float64(c + Float64(y * Float64(b + Float64(y * Float64(y + a)))))))
	tmp = 0.0
	if (y <= -2.4e+48)
		tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(x * a) / y));
	elseif (y <= 1.65e+48)
		tmp = Float64(Float64(t / t_1) + Float64(Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * Float64(z + Float64(y * x))))))) / t_1));
	else
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = i + (y * (c + (y * (b + (y * (y + a))))));
	tmp = 0.0;
	if (y <= -2.4e+48)
		tmp = (x + (z / y)) - ((x * a) / y);
	elseif (y <= 1.65e+48)
		tmp = (t / t_1) + ((y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x))))))) / t_1);
	else
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i + N[(y * N[(c + N[(y * N[(b + N[(y * N[(y + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+48], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+48], N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * N[(z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+48}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{+48}:\\
\;\;\;\;\frac{t}{t\_1} + \frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.4000000000000001e48

    1. Initial program 0.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 71.9%

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

    if -2.4000000000000001e48 < y < 1.65000000000000011e48

    1. Initial program 97.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 97.7%

      \[\leadsto \color{blue}{\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(a + y\right)\right)\right)} + \frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + x \cdot y\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(a + y\right)\right)\right)}} \]

    if 1.65000000000000011e48 < y

    1. Initial program 0.8%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 59.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 72.8%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out72.8%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative72.8%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified72.8%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot \left(z + \frac{27464.7644705 - z \cdot a}{y}\right)}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+48}:\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+48}:\\ \;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)} + \frac{y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 83.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+44}:\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{elif}\;y \leq 3.25 \cdot 10^{+47}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y -2.8e+44)
   (- (+ x (/ z y)) (/ (* x a) y))
   (if (<= y 3.25e+47)
     (/
      (+ t (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y (+ z (* y x))))))))
      (+ i (* y (+ c (* y (+ b (* y (+ y a))))))))
     (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -2.8e+44) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else if (y <= 3.25e+47) {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	} else {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (y <= (-2.8d+44)) then
        tmp = (x + (z / y)) - ((x * a) / y)
    else if (y <= 3.25d+47) then
        tmp = (t + (y * (230661.510616d0 + (y * (27464.7644705d0 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))))
    else
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -2.8e+44) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else if (y <= 3.25e+47) {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	} else {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if y <= -2.8e+44:
		tmp = (x + (z / y)) - ((x * a) / y)
	elif y <= 3.25e+47:
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))))
	else:
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= -2.8e+44)
		tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(x * a) / y));
	elseif (y <= 3.25e+47)
		tmp = Float64(Float64(t + Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * Float64(z + Float64(y * x)))))))) / Float64(i + Float64(y * Float64(c + Float64(y * Float64(b + Float64(y * Float64(y + a))))))));
	else
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (y <= -2.8e+44)
		tmp = (x + (z / y)) - ((x * a) / y);
	elseif (y <= 3.25e+47)
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	else
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -2.8e+44], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.25e+47], N[(N[(t + N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * N[(z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * N[(b + N[(y * N[(y + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+44}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\

\mathbf{elif}\;y \leq 3.25 \cdot 10^{+47}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.8000000000000001e44

    1. Initial program 0.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 71.9%

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

    if -2.8000000000000001e44 < y < 3.24999999999999994e47

    1. Initial program 97.7%

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

    if 3.24999999999999994e47 < y

    1. Initial program 0.8%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 59.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 72.8%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out72.8%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative72.8%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified72.8%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot \left(z + \frac{27464.7644705 - z \cdot a}{y}\right)}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+44}:\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{elif}\;y \leq 3.25 \cdot 10^{+47}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+46}:\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+16}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y -3.5e+46)
   (- (+ x (/ z y)) (/ (* x a) y))
   (if (<= y 1.45e+16)
     (/
      (+ t (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y z))))))
      (+ i (* y (+ c (* y (+ b (* y (+ y a))))))))
     (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -3.5e+46) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else if (y <= 1.45e+16) {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	} else {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (y <= (-3.5d+46)) then
        tmp = (x + (z / y)) - ((x * a) / y)
    else if (y <= 1.45d+16) then
        tmp = (t + (y * (230661.510616d0 + (y * (27464.7644705d0 + (y * z)))))) / (i + (y * (c + (y * (b + (y * (y + a)))))))
    else
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -3.5e+46) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else if (y <= 1.45e+16) {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	} else {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if y <= -3.5e+46:
		tmp = (x + (z / y)) - ((x * a) / y)
	elif y <= 1.45e+16:
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * (y + a)))))))
	else:
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= -3.5e+46)
		tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(x * a) / y));
	elseif (y <= 1.45e+16)
		tmp = Float64(Float64(t + Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * z)))))) / Float64(i + Float64(y * Float64(c + Float64(y * Float64(b + Float64(y * Float64(y + a))))))));
	else
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (y <= -3.5e+46)
		tmp = (x + (z / y)) - ((x * a) / y);
	elseif (y <= 1.45e+16)
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	else
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -3.5e+46], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+16], N[(N[(t + N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * N[(b + N[(y * N[(y + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+46}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+16}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.49999999999999985e46

    1. Initial program 0.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 71.9%

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

    if -3.49999999999999985e46 < y < 1.45e16

    1. Initial program 99.0%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 92.8%

      \[\leadsto \frac{\left(\left(\color{blue}{y \cdot z} + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]

    if 1.45e16 < y

    1. Initial program 2.6%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 56.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 69.2%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out69.2%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative69.2%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified69.2%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot \left(z + \frac{27464.7644705 - z \cdot a}{y}\right)}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+46}:\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+16}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.1 \cdot 10^{+35} \lor \neg \left(y \leq 1.45 \cdot 10^{+16}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot a\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -5.1e+35) (not (<= y 1.45e+16)))
   (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y))
   (/
    (+ t (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y z))))))
    (+ i (* y (+ c (* y (+ b (* y a)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -5.1e+35) || !(y <= 1.45e+16)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * a))))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-5.1d+35)) .or. (.not. (y <= 1.45d+16))) then
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    else
        tmp = (t + (y * (230661.510616d0 + (y * (27464.7644705d0 + (y * z)))))) / (i + (y * (c + (y * (b + (y * a))))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -5.1e+35) || !(y <= 1.45e+16)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * a))))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -5.1e+35) or not (y <= 1.45e+16):
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	else:
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * a))))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -5.1e+35) || !(y <= 1.45e+16))
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	else
		tmp = Float64(Float64(t + Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * z)))))) / Float64(i + Float64(y * Float64(c + Float64(y * Float64(b + Float64(y * a)))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -5.1e+35) || ~((y <= 1.45e+16)))
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	else
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * (b + (y * a))))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -5.1e+35], N[Not[LessEqual[y, 1.45e+16]], $MachinePrecision]], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * N[(b + N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{+35} \lor \neg \left(y \leq 1.45 \cdot 10^{+16}\right):\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot a\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.10000000000000017e35 or 1.45e16 < y

    1. Initial program 2.5%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 57.4%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 70.1%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out70.1%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative70.1%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified70.1%

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

    if -5.10000000000000017e35 < y < 1.45e16

    1. Initial program 99.0%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 92.8%

      \[\leadsto \frac{\left(\left(\color{blue}{y \cdot z} + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    4. Taylor expanded in y around 0 92.1%

      \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot \left(b + a \cdot y\right)} + c\right) \cdot y + i} \]
    5. Step-by-step derivation
      1. *-commutative92.1%

        \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(y \cdot \left(b + \color{blue}{y \cdot a}\right) + c\right) \cdot y + i} \]
    6. Simplified92.1%

      \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot \left(b + y \cdot a\right)} + c\right) \cdot y + i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.1 \cdot 10^{+35} \lor \neg \left(y \leq 1.45 \cdot 10^{+16}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot a\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+31} \lor \neg \left(y \leq 4.2 \cdot 10^{+15}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -4.5e+31) (not (<= y 4.2e+15)))
   (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y))
   (/
    (+ t (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y z))))))
    (+ i (* y (+ c (* y b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -4.5e+31) || !(y <= 4.2e+15)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-4.5d+31)) .or. (.not. (y <= 4.2d+15))) then
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    else
        tmp = (t + (y * (230661.510616d0 + (y * (27464.7644705d0 + (y * z)))))) / (i + (y * (c + (y * b))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -4.5e+31) || !(y <= 4.2e+15)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -4.5e+31) or not (y <= 4.2e+15):
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	else:
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * b))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -4.5e+31) || !(y <= 4.2e+15))
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	else
		tmp = Float64(Float64(t + Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * z)))))) / Float64(i + Float64(y * Float64(c + Float64(y * b)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -4.5e+31) || ~((y <= 4.2e+15)))
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	else
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * z)))))) / (i + (y * (c + (y * b))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -4.5e+31], N[Not[LessEqual[y, 4.2e+15]], $MachinePrecision]], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+31} \lor \neg \left(y \leq 4.2 \cdot 10^{+15}\right):\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.4999999999999996e31 or 4.2e15 < y

    1. Initial program 3.3%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 56.9%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 69.5%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out69.5%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative69.5%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified69.5%

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

    if -4.4999999999999996e31 < y < 4.2e15

    1. Initial program 99.0%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 92.8%

      \[\leadsto \frac{\left(\left(\color{blue}{y \cdot z} + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    4. Taylor expanded in y around 0 90.7%

      \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{b \cdot y} + c\right) \cdot y + i} \]
    5. Step-by-step derivation
      1. *-commutative90.7%

        \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
    6. Simplified90.7%

      \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+31} \lor \neg \left(y \leq 4.2 \cdot 10^{+15}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)\right)}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+36} \lor \neg \left(y \leq 1.45 \cdot 10^{+16}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -6.8e+36) (not (<= y 1.45e+16)))
   (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y))
   (/ (+ t (* y 230661.510616)) (+ i (* y (+ c (* y (+ b (* y (+ y a))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -6.8e+36) || !(y <= 1.45e+16)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-6.8d+36)) .or. (.not. (y <= 1.45d+16))) then
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    else
        tmp = (t + (y * 230661.510616d0)) / (i + (y * (c + (y * (b + (y * (y + a)))))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -6.8e+36) || !(y <= 1.45e+16)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -6.8e+36) or not (y <= 1.45e+16):
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	else:
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * (b + (y * (y + a)))))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -6.8e+36) || !(y <= 1.45e+16))
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	else
		tmp = Float64(Float64(t + Float64(y * 230661.510616)) / Float64(i + Float64(y * Float64(c + Float64(y * Float64(b + Float64(y * Float64(y + a))))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -6.8e+36) || ~((y <= 1.45e+16)))
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	else
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -6.8e+36], N[Not[LessEqual[y, 1.45e+16]], $MachinePrecision]], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * 230661.510616), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * N[(b + N[(y * N[(y + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+36} \lor \neg \left(y \leq 1.45 \cdot 10^{+16}\right):\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.7999999999999996e36 or 1.45e16 < y

    1. Initial program 2.5%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 57.4%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 70.1%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out70.1%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative70.1%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified70.1%

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

    if -6.7999999999999996e36 < y < 1.45e16

    1. Initial program 99.0%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 86.9%

      \[\leadsto \frac{\color{blue}{230661.510616 \cdot y} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    4. Step-by-step derivation
      1. *-commutative86.9%

        \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Simplified86.9%

      \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{+36} \lor \neg \left(y \leq 1.45 \cdot 10^{+16}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -96000000 \lor \neg \left(y \leq 1.35 \cdot 10^{+16}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot 27464.7644705\right)}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -96000000.0) (not (<= y 1.35e+16)))
   (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y))
   (/
    (+ t (* y (+ 230661.510616 (* y 27464.7644705))))
    (+ i (* y (+ c (* y b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -96000000.0) || !(y <= 1.35e+16)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * (230661.510616 + (y * 27464.7644705)))) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-96000000.0d0)) .or. (.not. (y <= 1.35d+16))) then
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    else
        tmp = (t + (y * (230661.510616d0 + (y * 27464.7644705d0)))) / (i + (y * (c + (y * b))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -96000000.0) || !(y <= 1.35e+16)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * (230661.510616 + (y * 27464.7644705)))) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -96000000.0) or not (y <= 1.35e+16):
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	else:
		tmp = (t + (y * (230661.510616 + (y * 27464.7644705)))) / (i + (y * (c + (y * b))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -96000000.0) || !(y <= 1.35e+16))
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	else
		tmp = Float64(Float64(t + Float64(y * Float64(230661.510616 + Float64(y * 27464.7644705)))) / Float64(i + Float64(y * Float64(c + Float64(y * b)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -96000000.0) || ~((y <= 1.35e+16)))
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	else
		tmp = (t + (y * (230661.510616 + (y * 27464.7644705)))) / (i + (y * (c + (y * b))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -96000000.0], N[Not[LessEqual[y, 1.35e+16]], $MachinePrecision]], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * N[(230661.510616 + N[(y * 27464.7644705), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -96000000 \lor \neg \left(y \leq 1.35 \cdot 10^{+16}\right):\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot 27464.7644705\right)}{i + y \cdot \left(c + y \cdot b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.6e7 or 1.35e16 < y

    1. Initial program 4.9%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 56.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 68.7%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out68.7%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative68.7%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified68.7%

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

    if -9.6e7 < y < 1.35e16

    1. Initial program 99.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 94.0%

      \[\leadsto \frac{\left(\left(\color{blue}{y \cdot z} + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    4. Taylor expanded in y around 0 91.9%

      \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{b \cdot y} + c\right) \cdot y + i} \]
    5. Step-by-step derivation
      1. *-commutative91.9%

        \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
    6. Simplified91.9%

      \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
    7. Taylor expanded in z around 0 87.3%

      \[\leadsto \color{blue}{\frac{t + y \cdot \left(230661.510616 + 27464.7644705 \cdot y\right)}{i + y \cdot \left(c + b \cdot y\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -96000000 \lor \neg \left(y \leq 1.35 \cdot 10^{+16}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot 27464.7644705\right)}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 73.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -75000000 \lor \neg \left(y \leq 8 \cdot 10^{+15}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -75000000.0) (not (<= y 8e+15)))
   (+ x (/ (+ z (/ (- 27464.7644705 (* z a)) y)) y))
   (/ (+ t (* y 230661.510616)) (+ i (* y (+ c (* y b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -75000000.0) || !(y <= 8e+15)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-75000000.0d0)) .or. (.not. (y <= 8d+15))) then
        tmp = x + ((z + ((27464.7644705d0 - (z * a)) / y)) / y)
    else
        tmp = (t + (y * 230661.510616d0)) / (i + (y * (c + (y * b))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -75000000.0) || !(y <= 8e+15)) {
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -75000000.0) or not (y <= 8e+15):
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y)
	else:
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -75000000.0) || !(y <= 8e+15))
		tmp = Float64(x + Float64(Float64(z + Float64(Float64(27464.7644705 - Float64(z * a)) / y)) / y));
	else
		tmp = Float64(Float64(t + Float64(y * 230661.510616)) / Float64(i + Float64(y * Float64(c + Float64(y * b)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -75000000.0) || ~((y <= 8e+15)))
		tmp = x + ((z + ((27464.7644705 - (z * a)) / y)) / y);
	else
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -75000000.0], N[Not[LessEqual[y, 8e+15]], $MachinePrecision]], N[(x + N[(N[(z + N[(N[(27464.7644705 - N[(z * a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * 230661.510616), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -75000000 \lor \neg \left(y \leq 8 \cdot 10^{+15}\right):\\
\;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.5e7 or 8e15 < y

    1. Initial program 4.9%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around -inf 56.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{\left(-1 \cdot z + -1 \cdot \frac{27464.7644705 - \left(-1 \cdot \left(a \cdot \left(-1 \cdot z - -1 \cdot \left(a \cdot x\right)\right)\right) + b \cdot x\right)}{y}\right) - -1 \cdot \left(a \cdot x\right)}{y}} \]
    4. Taylor expanded in x around 0 68.7%

      \[\leadsto x + -1 \cdot \color{blue}{\frac{-1 \cdot z + -1 \cdot \frac{27464.7644705 - a \cdot z}{y}}{y}} \]
    5. Step-by-step derivation
      1. distribute-lft-out68.7%

        \[\leadsto x + -1 \cdot \frac{\color{blue}{-1 \cdot \left(z + \frac{27464.7644705 - a \cdot z}{y}\right)}}{y} \]
      2. *-commutative68.7%

        \[\leadsto x + -1 \cdot \frac{-1 \cdot \left(z + \frac{27464.7644705 - \color{blue}{z \cdot a}}{y}\right)}{y} \]
    6. Simplified68.7%

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

    if -7.5e7 < y < 8e15

    1. Initial program 99.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 88.6%

      \[\leadsto \frac{\color{blue}{230661.510616 \cdot y} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    4. Step-by-step derivation
      1. *-commutative88.6%

        \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Simplified88.6%

      \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    6. Taylor expanded in y around 0 87.2%

      \[\leadsto \frac{y \cdot 230661.510616 + t}{\left(\color{blue}{b \cdot y} + c\right) \cdot y + i} \]
    7. Step-by-step derivation
      1. *-commutative91.9%

        \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
    8. Simplified87.2%

      \[\leadsto \frac{y \cdot 230661.510616 + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -75000000 \lor \neg \left(y \leq 8 \cdot 10^{+15}\right):\\ \;\;\;\;x + \frac{z + \frac{27464.7644705 - z \cdot a}{y}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 72.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -100000000 \lor \neg \left(y \leq 5.5 \cdot 10^{+16}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -100000000.0) (not (<= y 5.5e+16)))
   (- (+ x (/ z y)) (/ (* x a) y))
   (/ (+ t (* y 230661.510616)) (+ i (* y (+ c (* y b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -100000000.0) || !(y <= 5.5e+16)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-100000000.0d0)) .or. (.not. (y <= 5.5d+16))) then
        tmp = (x + (z / y)) - ((x * a) / y)
    else
        tmp = (t + (y * 230661.510616d0)) / (i + (y * (c + (y * b))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -100000000.0) || !(y <= 5.5e+16)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -100000000.0) or not (y <= 5.5e+16):
		tmp = (x + (z / y)) - ((x * a) / y)
	else:
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -100000000.0) || !(y <= 5.5e+16))
		tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(x * a) / y));
	else
		tmp = Float64(Float64(t + Float64(y * 230661.510616)) / Float64(i + Float64(y * Float64(c + Float64(y * b)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -100000000.0) || ~((y <= 5.5e+16)))
		tmp = (x + (z / y)) - ((x * a) / y);
	else
		tmp = (t + (y * 230661.510616)) / (i + (y * (c + (y * b))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -100000000.0], N[Not[LessEqual[y, 5.5e+16]], $MachinePrecision]], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * 230661.510616), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000000 \lor \neg \left(y \leq 5.5 \cdot 10^{+16}\right):\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e8 or 5.5e16 < y

    1. Initial program 4.9%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 66.9%

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

    if -1e8 < y < 5.5e16

    1. Initial program 99.0%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 88.0%

      \[\leadsto \frac{\color{blue}{230661.510616 \cdot y} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    4. Step-by-step derivation
      1. *-commutative88.0%

        \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Simplified88.0%

      \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    6. Taylor expanded in y around 0 86.6%

      \[\leadsto \frac{y \cdot 230661.510616 + t}{\left(\color{blue}{b \cdot y} + c\right) \cdot y + i} \]
    7. Step-by-step derivation
      1. *-commutative91.2%

        \[\leadsto \frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
    8. Simplified86.6%

      \[\leadsto \frac{y \cdot 230661.510616 + t}{\left(\color{blue}{y \cdot b} + c\right) \cdot y + i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -100000000 \lor \neg \left(y \leq 5.5 \cdot 10^{+16}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 69.6% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -31500000 \lor \neg \left(y \leq 5.7 \cdot 10^{+16}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot c}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -31500000.0) (not (<= y 5.7e+16)))
   (- (+ x (/ z y)) (/ (* x a) y))
   (/ (+ t (* y 230661.510616)) (+ i (* y c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -31500000.0) || !(y <= 5.7e+16)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * c));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-31500000.0d0)) .or. (.not. (y <= 5.7d+16))) then
        tmp = (x + (z / y)) - ((x * a) / y)
    else
        tmp = (t + (y * 230661.510616d0)) / (i + (y * c))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -31500000.0) || !(y <= 5.7e+16)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = (t + (y * 230661.510616)) / (i + (y * c));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -31500000.0) or not (y <= 5.7e+16):
		tmp = (x + (z / y)) - ((x * a) / y)
	else:
		tmp = (t + (y * 230661.510616)) / (i + (y * c))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -31500000.0) || !(y <= 5.7e+16))
		tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(x * a) / y));
	else
		tmp = Float64(Float64(t + Float64(y * 230661.510616)) / Float64(i + Float64(y * c)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -31500000.0) || ~((y <= 5.7e+16)))
		tmp = (x + (z / y)) - ((x * a) / y);
	else
		tmp = (t + (y * 230661.510616)) / (i + (y * c));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -31500000.0], N[Not[LessEqual[y, 5.7e+16]], $MachinePrecision]], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * 230661.510616), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -31500000 \lor \neg \left(y \leq 5.7 \cdot 10^{+16}\right):\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.15e7 or 5.7e16 < y

    1. Initial program 4.9%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 66.9%

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

    if -3.15e7 < y < 5.7e16

    1. Initial program 99.0%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 88.0%

      \[\leadsto \frac{\color{blue}{230661.510616 \cdot y} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    4. Step-by-step derivation
      1. *-commutative88.0%

        \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Simplified88.0%

      \[\leadsto \frac{\color{blue}{y \cdot 230661.510616} + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    6. Taylor expanded in y around 0 78.7%

      \[\leadsto \frac{y \cdot 230661.510616 + t}{\color{blue}{c \cdot y} + i} \]
    7. Step-by-step derivation
      1. *-commutative78.7%

        \[\leadsto \frac{y \cdot 230661.510616 + t}{\color{blue}{y \cdot c} + i} \]
    8. Simplified78.7%

      \[\leadsto \frac{y \cdot 230661.510616 + t}{\color{blue}{y \cdot c} + i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -31500000 \lor \neg \left(y \leq 5.7 \cdot 10^{+16}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot c}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.1% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5000000 \lor \neg \left(y \leq 1.9 \cdot 10^{+15}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -5000000.0) (not (<= y 1.9e+15)))
   (- (+ x (/ z y)) (/ (* x a) y))
   (/ t (+ i (* y (+ c (* y b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -5000000.0) || !(y <= 1.9e+15)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = t / (i + (y * (c + (y * b))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-5000000.0d0)) .or. (.not. (y <= 1.9d+15))) then
        tmp = (x + (z / y)) - ((x * a) / y)
    else
        tmp = t / (i + (y * (c + (y * b))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -5000000.0) || !(y <= 1.9e+15)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = t / (i + (y * (c + (y * b))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -5000000.0) or not (y <= 1.9e+15):
		tmp = (x + (z / y)) - ((x * a) / y)
	else:
		tmp = t / (i + (y * (c + (y * b))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -5000000.0) || !(y <= 1.9e+15))
		tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(x * a) / y));
	else
		tmp = Float64(t / Float64(i + Float64(y * Float64(c + Float64(y * b)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -5000000.0) || ~((y <= 1.9e+15)))
		tmp = (x + (z / y)) - ((x * a) / y);
	else
		tmp = t / (i + (y * (c + (y * b))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -5000000.0], N[Not[LessEqual[y, 1.9e+15]], $MachinePrecision]], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t / N[(i + N[(y * N[(c + N[(y * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5000000 \lor \neg \left(y \leq 1.9 \cdot 10^{+15}\right):\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5e6 or 1.9e15 < y

    1. Initial program 5.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 65.8%

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

    if -5e6 < y < 1.9e15

    1. Initial program 99.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 76.0%

      \[\leadsto \color{blue}{\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(a + y\right)\right)\right)}} \]
    4. Taylor expanded in y around 0 74.6%

      \[\leadsto \frac{t}{i + y \cdot \left(c + \color{blue}{b \cdot y}\right)} \]
    5. Step-by-step derivation
      1. *-commutative74.6%

        \[\leadsto \frac{t}{i + y \cdot \left(c + \color{blue}{y \cdot b}\right)} \]
    6. Simplified74.6%

      \[\leadsto \frac{t}{i + y \cdot \left(c + \color{blue}{y \cdot b}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5000000 \lor \neg \left(y \leq 1.9 \cdot 10^{+15}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 63.8% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -32000000 \lor \neg \left(y \leq 4.3 \cdot 10^{+15}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{i + y \cdot c}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -32000000.0) (not (<= y 4.3e+15)))
   (- (+ x (/ z y)) (/ (* x a) y))
   (/ t (+ i (* y c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -32000000.0) || !(y <= 4.3e+15)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = t / (i + (y * c));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((y <= (-32000000.0d0)) .or. (.not. (y <= 4.3d+15))) then
        tmp = (x + (z / y)) - ((x * a) / y)
    else
        tmp = t / (i + (y * c))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -32000000.0) || !(y <= 4.3e+15)) {
		tmp = (x + (z / y)) - ((x * a) / y);
	} else {
		tmp = t / (i + (y * c));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -32000000.0) or not (y <= 4.3e+15):
		tmp = (x + (z / y)) - ((x * a) / y)
	else:
		tmp = t / (i + (y * c))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -32000000.0) || !(y <= 4.3e+15))
		tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(x * a) / y));
	else
		tmp = Float64(t / Float64(i + Float64(y * c)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -32000000.0) || ~((y <= 4.3e+15)))
		tmp = (x + (z / y)) - ((x * a) / y);
	else
		tmp = t / (i + (y * c));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -32000000.0], N[Not[LessEqual[y, 4.3e+15]], $MachinePrecision]], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(x * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t / N[(i + N[(y * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -32000000 \lor \neg \left(y \leq 4.3 \cdot 10^{+15}\right):\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{i + y \cdot c}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.2e7 or 4.3e15 < y

    1. Initial program 5.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 65.8%

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

    if -3.2e7 < y < 4.3e15

    1. Initial program 99.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 76.0%

      \[\leadsto \color{blue}{\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(a + y\right)\right)\right)}} \]
    4. Taylor expanded in y around 0 69.5%

      \[\leadsto \frac{t}{i + \color{blue}{c \cdot y}} \]
    5. Step-by-step derivation
      1. *-commutative69.5%

        \[\leadsto \frac{t}{i + \color{blue}{y \cdot c}} \]
    6. Simplified69.5%

      \[\leadsto \frac{t}{i + \color{blue}{y \cdot c}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -32000000 \lor \neg \left(y \leq 4.3 \cdot 10^{+15}\right):\\ \;\;\;\;\left(x + \frac{z}{y}\right) - \frac{x \cdot a}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{i + y \cdot c}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 58.4% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -100000000:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+15}:\\ \;\;\;\;\frac{t}{i + y \cdot c}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y -100000000.0) x (if (<= y 3e+15) (/ t (+ i (* y c))) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -100000000.0) {
		tmp = x;
	} else if (y <= 3e+15) {
		tmp = t / (i + (y * c));
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (y <= (-100000000.0d0)) then
        tmp = x
    else if (y <= 3d+15) then
        tmp = t / (i + (y * c))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -100000000.0) {
		tmp = x;
	} else if (y <= 3e+15) {
		tmp = t / (i + (y * c));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if y <= -100000000.0:
		tmp = x
	elif y <= 3e+15:
		tmp = t / (i + (y * c))
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= -100000000.0)
		tmp = x;
	elseif (y <= 3e+15)
		tmp = Float64(t / Float64(i + Float64(y * c)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (y <= -100000000.0)
		tmp = x;
	elseif (y <= 3e+15)
		tmp = t / (i + (y * c));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -100000000.0], x, If[LessEqual[y, 3e+15], N[(t / N[(i + N[(y * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000000:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+15}:\\
\;\;\;\;\frac{t}{i + y \cdot c}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e8 or 3e15 < y

    1. Initial program 5.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 56.0%

      \[\leadsto \color{blue}{x} \]

    if -1e8 < y < 3e15

    1. Initial program 99.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 76.0%

      \[\leadsto \color{blue}{\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(a + y\right)\right)\right)}} \]
    4. Taylor expanded in y around 0 69.5%

      \[\leadsto \frac{t}{i + \color{blue}{c \cdot y}} \]
    5. Step-by-step derivation
      1. *-commutative69.5%

        \[\leadsto \frac{t}{i + \color{blue}{y \cdot c}} \]
    6. Simplified69.5%

      \[\leadsto \frac{t}{i + \color{blue}{y \cdot c}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 50.8% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.55 \cdot 10^{-39}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+15}:\\ \;\;\;\;\frac{t}{i}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= y -2.55e-39) x (if (<= y 4e+15) (/ t i) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -2.55e-39) {
		tmp = x;
	} else if (y <= 4e+15) {
		tmp = t / i;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (y <= (-2.55d-39)) then
        tmp = x
    else if (y <= 4d+15) then
        tmp = t / i
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (y <= -2.55e-39) {
		tmp = x;
	} else if (y <= 4e+15) {
		tmp = t / i;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if y <= -2.55e-39:
		tmp = x
	elif y <= 4e+15:
		tmp = t / i
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (y <= -2.55e-39)
		tmp = x;
	elseif (y <= 4e+15)
		tmp = Float64(t / i);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (y <= -2.55e-39)
		tmp = x;
	elseif (y <= 4e+15)
		tmp = t / i;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -2.55e-39], x, If[LessEqual[y, 4e+15], N[(t / i), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{-39}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\frac{t}{i}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.54999999999999994e-39 or 4e15 < y

    1. Initial program 12.1%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 53.2%

      \[\leadsto \color{blue}{x} \]

    if -2.54999999999999994e-39 < y < 4e15

    1. Initial program 99.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 55.2%

      \[\leadsto \color{blue}{\frac{t}{i}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 25.9% accurate, 33.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return x;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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), intent (in) :: c
    real(8), intent (in) :: i
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return x;
}
def code(x, y, z, t, a, b, c, i):
	return x
function code(x, y, z, t, a, b, c, i)
	return x
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 54.9%

    \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf 28.7%

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

Reproduce

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