Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2

Percentage Accurate: 55.0% → 84.3%
Time: 28.1s
Alternatives: 13
Speedup: 2.2×

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 13 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.0% 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: 84.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1
         (/
          (+
           t
           (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y (+ (* x y) z)))))))
          (+ i (* y (+ c (* y (+ b (* y (+ y a))))))))))
   (if (<= t_1 INFINITY) t_1 (+ (/ z y) (- x (/ a (/ y x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * ((x * y) + z))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (z / y) + (x - (a / (y / x)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * ((x * y) + z))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (z / y) + (x - (a / (y / x)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * ((x * y) + z))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (z / y) + (x - (a / (y / x)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(t + Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * Float64(Float64(x * y) + z))))))) / Float64(i + Float64(y * Float64(c + Float64(y * Float64(b + Float64(y * Float64(y + a))))))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(z / y) + Float64(x - Float64(a / Float64(y / x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * ((x * y) + z))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (z / y) + (x - (a / (y / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(t + N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * N[(N[(x * y), $MachinePrecision] + z), $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]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(z / y), $MachinePrecision] + N[(x - N[(a / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) 54929528941/2000000) y) 28832688827/125000) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < +inf.0

    1. Initial program 91.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 +inf.0 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) 54929528941/2000000) y) 28832688827/125000) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i))

    1. Initial program 0.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 inf 63.5%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative63.5%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+63.5%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*69.3%

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

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.7%

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

Alternative 2: 77.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -6.9 \cdot 10^{-25}:\\
\;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)}{t_1}\\

\mathbf{elif}\;y \leq -1.6 \cdot 10^{-54}:\\
\;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot t_1}\\

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

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -8.3999999999999996e86

    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 68.9%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative68.9%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+68.9%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*74.4%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified74.4%

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

    if -8.3999999999999996e86 < y < -6.89999999999999975e-25

    1. Initial program 53.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 i around 0 52.8%

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

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

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

    if -6.89999999999999975e-25 < y < -1.59999999999999999e-54

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

      \[\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. *-commutative90.4%

        \[\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. Simplified90.4%

      \[\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} \]

    if -1.59999999999999999e-54 < y < 2.94999999999999994e66

    1. Initial program 94.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 0 91.2%

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

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

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

    if 2.94999999999999994e66 < 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 64.0%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative64.0%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+64.0%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*70.5%

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

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 70.6%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification82.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.4 \cdot 10^{+86}:\\ \;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\ \mathbf{elif}\;y \leq -6.9 \cdot 10^{-25}:\\ \;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)}{c + y \cdot \left(b + y \cdot \left(y + a\right)\right)}\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{-54}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{+66}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{i + y \cdot \left(c + y \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 74.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -6.9 \cdot 10^{-25}:\\
\;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)}{t_1}\\

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-46}:\\
\;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot t_1}\\

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+113}:\\
\;\;\;\;x + \frac{z}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{1 + \frac{a}{y}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -2.39999999999999981e87

    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 68.9%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative68.9%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+68.9%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*74.4%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified74.4%

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

    if -2.39999999999999981e87 < y < -6.89999999999999975e-25

    1. Initial program 53.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 i around 0 52.8%

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

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

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

    if -6.89999999999999975e-25 < y < 9.1999999999999997e-46

    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 95.2%

      \[\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. *-commutative95.2%

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

      \[\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} \]

    if 9.1999999999999997e-46 < y < 1.56e41

    1. Initial program 78.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 i around 0 51.8%

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

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

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

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

    if 1.56e41 < y < 3.1999999999999998e113

    1. Initial program 21.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 inf 21.7%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative21.7%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+21.7%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*28.0%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified28.0%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 28.2%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]

    if 3.1999999999999998e113 < y

    1. Initial program 2.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 i around 0 2.8%

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

      \[\leadsto \color{blue}{\frac{x \cdot {y}^{3}}{c + y \cdot \left(b + y \cdot \left(a + y\right)\right)}} \]
    5. Step-by-step derivation
      1. associate-/l*0.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{c + y \cdot \left(b + y \cdot \left(a + y\right)\right)}{{y}^{3}}}} \]
      2. +-commutative0.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{y \cdot \left(b + y \cdot \left(a + y\right)\right) + c}}{{y}^{3}}} \]
      3. fma-udef0.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\mathsf{fma}\left(y, b + y \cdot \left(a + y\right), c\right)}}{{y}^{3}}} \]
      4. +-commutative0.0%

        \[\leadsto \frac{x}{\frac{\mathsf{fma}\left(y, \color{blue}{y \cdot \left(a + y\right) + b}, c\right)}{{y}^{3}}} \]
      5. +-commutative0.0%

        \[\leadsto \frac{x}{\frac{\mathsf{fma}\left(y, y \cdot \color{blue}{\left(y + a\right)} + b, c\right)}{{y}^{3}}} \]
      6. fma-udef0.0%

        \[\leadsto \frac{x}{\frac{\mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, y + a, b\right)}, c\right)}{{y}^{3}}} \]
    6. Simplified0.0%

      \[\leadsto \color{blue}{\frac{x}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right)}{{y}^{3}}}} \]
    7. Taylor expanded in y around inf 83.9%

      \[\leadsto \frac{x}{\color{blue}{1 + \frac{a}{y}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification80.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+87}:\\ \;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\ \mathbf{elif}\;y \leq -6.9 \cdot 10^{-25}:\\ \;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)}{c + y \cdot \left(b + y \cdot \left(y + a\right)\right)}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{elif}\;y \leq 1.56 \cdot 10^{+41}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{y \cdot \left(c + y \cdot b\right)}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+113}:\\ \;\;\;\;x + \frac{z}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 + \frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq -5.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)}{t_1}\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{t}{i + y \cdot t_1}\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+50}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{i}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.8000000000000004e86

    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 68.9%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative68.9%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+68.9%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*74.4%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified74.4%

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

    if -7.8000000000000004e86 < y < -5.4000000000000002e-33

    1. Initial program 59.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 i around 0 54.8%

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

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

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

    if -5.4000000000000002e-33 < y < 6.4999999999999998e-63

    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 80.8%

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

    if 6.4999999999999998e-63 < y < 4.1999999999999999e50

    1. Initial program 74.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 i around inf 38.5%

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

    if 4.1999999999999999e50 < y

    1. Initial program 4.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 58.8%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative58.8%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+58.8%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*66.8%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified66.8%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 66.9%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification71.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+86}:\\ \;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-33}:\\ \;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)}{c + y \cdot \left(b + y \cdot \left(y + a\right)\right)}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-63}:\\ \;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+50}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq -6.9 \cdot 10^{-25}:\\
\;\;\;\;\frac{230661.510616 + y \cdot \left(27464.7644705 + y \cdot z\right)}{t_1}\\

\mathbf{elif}\;y \leq 5 \cdot 10^{-56}:\\
\;\;\;\;\frac{t + y \cdot 230661.510616}{i + y \cdot t_1}\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+50}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{i}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.8000000000000004e86

    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 68.9%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative68.9%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+68.9%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*74.4%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified74.4%

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

    if -7.8000000000000004e86 < y < -6.89999999999999975e-25

    1. Initial program 53.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 i around 0 52.8%

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

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

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

    if -6.89999999999999975e-25 < y < 4.99999999999999997e-56

    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 95.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. *-commutative95.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. Simplified95.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} \]

    if 4.99999999999999997e-56 < y < 4.1999999999999999e50

    1. Initial program 74.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 i around inf 38.5%

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

    if 4.1999999999999999e50 < y

    1. Initial program 4.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 58.8%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative58.8%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+58.8%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*66.8%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified66.8%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 66.9%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification79.5%

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

Alternative 6: 81.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 2.6 \cdot 10^{+52}:\\
\;\;\;\;\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}{y}\\


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

    1. Initial program 7.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 62.5%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative62.5%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+62.5%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*67.0%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified67.0%

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

    if -5.3999999999999997e30 < y < 2.6e52

    1. Initial program 95.2%

      \[\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 89.7%

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

    if 2.6e52 < y

    1. Initial program 4.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 58.8%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative58.8%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+58.8%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*66.8%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified66.8%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 66.9%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+30}:\\ \;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+52}:\\ \;\;\;\;\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}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 9 \cdot 10^{-58}:\\
\;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+50}:\\
\;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(x \cdot y + z\right)\right)\right)}{i}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.8000000000000004e22

    1. Initial program 10.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 59.0%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative59.0%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+59.0%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*63.2%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified63.2%

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

    if -3.8000000000000004e22 < y < 9.0000000000000006e-58

    1. Initial program 99.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 t around inf 76.8%

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

    if 9.0000000000000006e-58 < y < 4.1999999999999999e50

    1. Initial program 74.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 i around inf 38.5%

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

    if 4.1999999999999999e50 < y

    1. Initial program 4.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 58.8%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative58.8%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+58.8%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*66.8%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified66.8%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 66.9%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.9%

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

Alternative 8: 59.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2700000000:\\
\;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{-129}:\\
\;\;\;\;\frac{t}{i}\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{t}{y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.7e9

    1. Initial program 10.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 59.0%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative59.0%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+59.0%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*63.2%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified63.2%

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

    if -2.7e9 < y < 5.80000000000000034e-129

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

      \[\leadsto \color{blue}{\frac{t}{i}} \]

    if 5.80000000000000034e-129 < y < 7.4999999999999998e28

    1. Initial program 92.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 i around 0 62.3%

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

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

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

    if 7.4999999999999998e28 < y

    1. Initial program 11.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 53.4%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative53.4%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+53.4%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*60.5%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified60.5%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 60.6%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification57.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2700000000:\\ \;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{t}{i}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+28}:\\ \;\;\;\;\frac{t}{y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 69.3% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;y \leq 2.95 \cdot 10^{+66}:\\
\;\;\;\;\frac{t}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


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

    1. Initial program 10.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 59.0%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative59.0%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+59.0%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*63.2%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified63.2%

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

    if -8.8e21 < y < 2.94999999999999994e66

    1. Initial program 94.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 t around inf 67.9%

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

    if 2.94999999999999994e66 < 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 64.0%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative64.0%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+64.0%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*70.5%

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

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 70.6%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.3%

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

Alternative 10: 58.6% accurate, 2.1× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\


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

    1. Initial program 10.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 59.0%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative59.0%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+59.0%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*63.2%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified63.2%

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

    if -8e21 < y < 4.4000000000000003e29

    1. Initial program 97.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 0 48.8%

      \[\leadsto \color{blue}{\frac{t}{i}} \]

    if 4.4000000000000003e29 < y

    1. Initial program 11.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 54.4%

      \[\leadsto \color{blue}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative54.4%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+54.4%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*61.5%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified61.5%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 61.6%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+21}:\\ \;\;\;\;\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{+29}:\\ \;\;\;\;\frac{t}{i}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.6% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.22 \lor \neg \left(y \leq 1.18 \cdot 10^{+30}\right):\\
\;\;\;\;x + \frac{z}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{i}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.220000000000000001 or 1.18e30 < y

    1. Initial program 11.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}{\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}} \]
    4. Step-by-step derivation
      1. +-commutative56.3%

        \[\leadsto \color{blue}{\left(\frac{z}{y} + x\right)} - \frac{a \cdot x}{y} \]
      2. associate--l+56.3%

        \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a \cdot x}{y}\right)} \]
      3. associate-/l*61.9%

        \[\leadsto \frac{z}{y} + \left(x - \color{blue}{\frac{a}{\frac{y}{x}}}\right) \]
    5. Simplified61.9%

      \[\leadsto \color{blue}{\frac{z}{y} + \left(x - \frac{a}{\frac{y}{x}}\right)} \]
    6. Taylor expanded in a around 0 61.7%

      \[\leadsto \color{blue}{x + \frac{z}{y}} \]

    if -0.220000000000000001 < y < 1.18e30

    1. Initial program 97.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 0 49.1%

      \[\leadsto \color{blue}{\frac{t}{i}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.8%

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

Alternative 12: 51.3% accurate, 2.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1850 or 4.50000000000000014e50 < y

    1. Initial program 8.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 44.1%

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

    if -1850 < y < 4.50000000000000014e50

    1. Initial program 96.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 0 47.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1850:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{t}{i}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 26.5% 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 59.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 20.7%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification20.7%

    \[\leadsto x \]
  5. Add Preprocessing

Reproduce

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