Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2

Percentage Accurate: 56.7% → 89.5%
Time: 21.8s
Alternatives: 16
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 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: 56.7% 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: 89.5% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 + \frac{a}{y}\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{+26} \lor \neg \left(y \leq 2.9 \cdot 10^{+54}\right):\\ \;\;\;\;x \cdot \left(\frac{1}{t\_1} + \frac{z}{x \cdot \left(y \cdot {t\_1}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ 1.0 (/ a y))))
   (if (or (<= y -1.95e+26) (not (<= y 2.9e+54)))
     (* x (+ (/ 1.0 t_1) (/ z (* x (* y (pow t_1 2.0))))))
     (/
      (fma (fma (fma (fma x y z) y 27464.7644705) y 230661.510616) y t)
      (fma (fma (fma (+ 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) {
	double t_1 = 1.0 + (a / y);
	double tmp;
	if ((y <= -1.95e+26) || !(y <= 2.9e+54)) {
		tmp = x * ((1.0 / t_1) + (z / (x * (y * pow(t_1, 2.0)))));
	} else {
		tmp = fma(fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma((y + a), y, b), y, c), y, i);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(1.0 + Float64(a / y))
	tmp = 0.0
	if ((y <= -1.95e+26) || !(y <= 2.9e+54))
		tmp = Float64(x * Float64(Float64(1.0 / t_1) + Float64(z / Float64(x * Float64(y * (t_1 ^ 2.0))))));
	else
		tmp = Float64(fma(fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(Float64(y + a), y, b), y, c), y, i));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(1.0 + N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -1.95e+26], N[Not[LessEqual[y, 2.9e+54]], $MachinePrecision]], N[(x * N[(N[(1.0 / t$95$1), $MachinePrecision] + N[(z / N[(x * N[(y * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * y + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(y + a), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 1 + \frac{a}{y}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+26} \lor \neg \left(y \leq 2.9 \cdot 10^{+54}\right):\\
\;\;\;\;x \cdot \left(\frac{1}{t\_1} + \frac{z}{x \cdot \left(y \cdot {t\_1}^{2}\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.95e26 or 2.8999999999999999e54 < y

    1. Initial program 0.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num0.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}}} \]
      2. inv-pow0.7%

        \[\leadsto \color{blue}{{\left(\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}\right)}^{-1}} \]
    4. Applied egg-rr0.7%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-10.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
      2. fma-undefine0.7%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{x \cdot y + z}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      3. *-commutative0.7%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{y \cdot x} + z, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      4. fma-define0.7%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, x, z\right)}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
    6. Simplified0.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, x, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
    7. Taylor expanded in y around inf 53.1%

      \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{x} + \frac{a}{x \cdot y}\right) - \frac{z}{{x}^{2} \cdot y}}} \]
    8. Taylor expanded in x around inf 81.6%

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

    if -1.95e26 < y < 2.8999999999999999e54

    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. Step-by-step derivation
      1. fma-define96.3%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616, y, t\right)}}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
      2. fma-define96.4%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705, y, 230661.510616\right)}, y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
      3. fma-define96.4%

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x \cdot y + z, y, 27464.7644705\right)}, y, 230661.510616\right), y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
      4. fma-define96.4%

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(x, y, z\right)}, y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
      5. fma-define96.4%

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\color{blue}{\mathsf{fma}\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c, y, i\right)}} \]
      6. fma-define96.4%

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\left(y + a\right) \cdot y + b, y, c\right)}, y, i\right)} \]
      7. fma-define96.4%

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(y + a, y, b\right)}, y, c\right), y, i\right)} \]
    3. Simplified96.4%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{+26} \lor \neg \left(y \leq 2.9 \cdot 10^{+54}\right):\\ \;\;\;\;x \cdot \left(\frac{1}{1 + \frac{a}{y}} + \frac{z}{x \cdot \left(y \cdot {\left(1 + \frac{a}{y}\right)}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 89.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 + \frac{a}{y}\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{+26} \lor \neg \left(y \leq 6.2 \cdot 10^{+56}\right):\\ \;\;\;\;x \cdot \left(\frac{1}{t\_1} + \frac{z}{x \cdot \left(y \cdot {t\_1}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t + y \cdot \left(230661.510616 + y \cdot \left(27464.7644705 + y \cdot \left(z + y \cdot x\right)\right)\right)}{i + y \cdot \left(c + y \cdot \left(b + y \cdot \left(y + a\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ 1.0 (/ a y))))
   (if (or (<= y -1.95e+26) (not (<= y 6.2e+56)))
     (* x (+ (/ 1.0 t_1) (/ z (* x (* y (pow t_1 2.0))))))
     (/
      (+ t (* y (+ 230661.510616 (* y (+ 27464.7644705 (* y (+ z (* y x))))))))
      (+ i (* y (+ c (* y (+ b (* y (+ y a)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 1.0 + (a / y);
	double tmp;
	if ((y <= -1.95e+26) || !(y <= 6.2e+56)) {
		tmp = x * ((1.0 / t_1) + (z / (x * (y * pow(t_1, 2.0)))));
	} else {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 1.0d0 + (a / y)
    if ((y <= (-1.95d+26)) .or. (.not. (y <= 6.2d+56))) then
        tmp = x * ((1.0d0 / t_1) + (z / (x * (y * (t_1 ** 2.0d0)))))
    else
        tmp = (t + (y * (230661.510616d0 + (y * (27464.7644705d0 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 1.0 + (a / y);
	double tmp;
	if ((y <= -1.95e+26) || !(y <= 6.2e+56)) {
		tmp = x * ((1.0 / t_1) + (z / (x * (y * Math.pow(t_1, 2.0)))));
	} else {
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 1.0 + (a / y)
	tmp = 0
	if (y <= -1.95e+26) or not (y <= 6.2e+56):
		tmp = x * ((1.0 / t_1) + (z / (x * (y * math.pow(t_1, 2.0)))))
	else:
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(1.0 + Float64(a / y))
	tmp = 0.0
	if ((y <= -1.95e+26) || !(y <= 6.2e+56))
		tmp = Float64(x * Float64(Float64(1.0 / t_1) + Float64(z / Float64(x * Float64(y * (t_1 ^ 2.0))))));
	else
		tmp = Float64(Float64(t + Float64(y * Float64(230661.510616 + Float64(y * Float64(27464.7644705 + Float64(y * Float64(z + Float64(y * x)))))))) / Float64(i + Float64(y * Float64(c + Float64(y * Float64(b + Float64(y * Float64(y + a))))))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 1.0 + (a / y);
	tmp = 0.0;
	if ((y <= -1.95e+26) || ~((y <= 6.2e+56)))
		tmp = x * ((1.0 / t_1) + (z / (x * (y * (t_1 ^ 2.0)))));
	else
		tmp = (t + (y * (230661.510616 + (y * (27464.7644705 + (y * (z + (y * x)))))))) / (i + (y * (c + (y * (b + (y * (y + a)))))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(1.0 + N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -1.95e+26], N[Not[LessEqual[y, 6.2e+56]], $MachinePrecision]], N[(x * N[(N[(1.0 / t$95$1), $MachinePrecision] + N[(z / N[(x * N[(y * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + N[(y * N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * N[(z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(i + N[(y * N[(c + N[(y * N[(b + N[(y * N[(y + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 1 + \frac{a}{y}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+26} \lor \neg \left(y \leq 6.2 \cdot 10^{+56}\right):\\
\;\;\;\;x \cdot \left(\frac{1}{t\_1} + \frac{z}{x \cdot \left(y \cdot {t\_1}^{2}\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.95e26 or 6.20000000000000009e56 < y

    1. Initial program 0.7%

      \[\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num0.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}}} \]
      2. inv-pow0.7%

        \[\leadsto \color{blue}{{\left(\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}\right)}^{-1}} \]
    4. Applied egg-rr0.7%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-10.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
      2. fma-undefine0.7%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{x \cdot y + z}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      3. *-commutative0.7%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{y \cdot x} + z, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      4. fma-define0.7%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, x, z\right)}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
    6. Simplified0.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, x, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
    7. Taylor expanded in y around inf 53.1%

      \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{x} + \frac{a}{x \cdot y}\right) - \frac{z}{{x}^{2} \cdot y}}} \]
    8. Taylor expanded in x around inf 81.6%

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

    if -1.95e26 < y < 6.20000000000000009e56

    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. Recombined 2 regimes into one program.
  4. Final simplification89.9%

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

Alternative 3: 84.3% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x + \left(\frac{z}{y} - a \cdot \frac{x}{y}\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) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < +inf.0

    1. Initial program 87.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. Step-by-step derivation
      1. clear-num87.6%

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

        \[\leadsto \color{blue}{{\left(\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}\right)}^{-1}} \]
    4. Applied egg-rr87.6%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-187.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
      2. fma-undefine87.6%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{x \cdot y + z}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      3. *-commutative87.6%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{y \cdot x} + z, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      4. fma-define87.6%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, x, z\right)}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
    6. Simplified87.6%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, x, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
    7. Taylor expanded in t around inf 82.2%

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

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

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

    if +inf.0 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) 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 72.9%

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

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

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

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

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

Alternative 4: 85.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9999999999999999e60 or 6.79999999999999973e69 < y

    1. Initial program 0.4%

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

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

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

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

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

    if -1.9999999999999999e60 < y < 6.79999999999999973e69

    1. Initial program 90.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. Recombined 2 regimes into one program.
  4. Final simplification85.5%

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

Alternative 5: 84.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+54} \lor \neg \left(y \leq 3.6 \cdot 10^{+68}\right):\\
\;\;\;\;x + \left(\frac{z}{y} - a \cdot \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.7500000000000001e54 or 3.5999999999999999e68 < y

    1. Initial program 0.4%

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

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

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

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

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

    if -1.7500000000000001e54 < y < 3.5999999999999999e68

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

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

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

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

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

Alternative 6: 80.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.89999999999999998e56 or 1.52e69 < y

    1. Initial program 0.4%

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

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

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

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

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

    if -1.89999999999999998e56 < y < 1.52e69

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

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

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

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

      \[\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 + y \cdot \left(c + b \cdot y\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.3%

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

Alternative 7: 78.1% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2000000000000004e53 or 2.6000000000000001e40 < y

    1. Initial program 3.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 y around inf 67.3%

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

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

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

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

    if -4.2000000000000004e53 < y < 2.6000000000000001e40

    1. Initial program 95.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 z around inf 87.5%

      \[\leadsto \frac{\left(\color{blue}{{y}^{2} \cdot z} + 230661.510616\right) \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. unpow287.5%

        \[\leadsto \frac{\left(\color{blue}{\left(y \cdot y\right)} \cdot z + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Applied egg-rr87.5%

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

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

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

Alternative 8: 76.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8e53 or 3.5999999999999999e68 < y

    1. Initial program 0.4%

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

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

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

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

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

    if -2.8e53 < y < 3.5999999999999999e68

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

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

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

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

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

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

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

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

Alternative 9: 74.8% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.4e53 or 1.90000000000000002e40 < y

    1. Initial program 3.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 y around inf 67.3%

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

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

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

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

    if -2.4e53 < y < 1.90000000000000002e40

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

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

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

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

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

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

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

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

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

Alternative 10: 71.7% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+53} \lor \neg \left(y \leq 2 \cdot 10^{+37}\right):\\
\;\;\;\;x + \left(\frac{z}{y} - a \cdot \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.4e53 or 1.99999999999999991e37 < y

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

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

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

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

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

    if -2.4e53 < y < 1.99999999999999991e37

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

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

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

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

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

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

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

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

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

Alternative 11: 61.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-9} \lor \neg \left(y \leq 2.4 \cdot 10^{+32}\right):\\
\;\;\;\;x + \left(\frac{z}{y} - a \cdot \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.65000000000000009e-9 or 2.39999999999999991e32 < y

    1. Initial program 9.3%

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

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

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

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

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

    if -1.65000000000000009e-9 < y < 2.39999999999999991e32

    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 z around inf 92.9%

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

      \[\leadsto \color{blue}{\frac{t + y \cdot \left(230661.510616 + {y}^{2} \cdot z\right)}{i}} \]
    5. Taylor expanded in y around 0 66.2%

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

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

Alternative 12: 60.5% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -27500000 \lor \neg \left(y \leq 7 \cdot 10^{+28}\right):\\
\;\;\;\;\frac{x}{1 + \frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.75e7 or 6.9999999999999999e28 < y

    1. Initial program 7.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. Step-by-step derivation
      1. clear-num7.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}}} \]
      2. inv-pow7.1%

        \[\leadsto \color{blue}{{\left(\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}\right)}^{-1}} \]
    4. Applied egg-rr7.1%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-17.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
      2. fma-undefine7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{x \cdot y + z}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      3. *-commutative7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{y \cdot x} + z, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      4. fma-define7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, x, z\right)}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
    6. Simplified7.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, x, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
    7. Taylor expanded in y around inf 49.5%

      \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{x} + \frac{a}{x \cdot y}\right) - \frac{z}{{x}^{2} \cdot y}}} \]
    8. Taylor expanded in x around inf 62.8%

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

    if -2.75e7 < y < 6.9999999999999999e28

    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 z around inf 92.3%

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

      \[\leadsto \color{blue}{\frac{t + y \cdot \left(230661.510616 + {y}^{2} \cdot z\right)}{i}} \]
    5. Taylor expanded in y around 0 64.7%

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

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

Alternative 13: 60.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -68000000 \lor \neg \left(y \leq 2.5 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{1 + \frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.8e7 or 2.50000000000000012e25 < y

    1. Initial program 7.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. Step-by-step derivation
      1. clear-num7.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}}} \]
      2. inv-pow7.1%

        \[\leadsto \color{blue}{{\left(\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}\right)}^{-1}} \]
    4. Applied egg-rr7.1%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-17.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
      2. fma-undefine7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{x \cdot y + z}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      3. *-commutative7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{y \cdot x} + z, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      4. fma-define7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, x, z\right)}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
    6. Simplified7.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, x, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
    7. Taylor expanded in y around inf 49.5%

      \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{x} + \frac{a}{x \cdot y}\right) - \frac{z}{{x}^{2} \cdot y}}} \]
    8. Taylor expanded in x around inf 62.8%

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

    if -6.8e7 < y < 2.50000000000000012e25

    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 z around inf 92.3%

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

      \[\leadsto \color{blue}{\frac{t + y \cdot \left(230661.510616 + {y}^{2} \cdot z\right)}{i}} \]
    5. Taylor expanded in y around 0 64.7%

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

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

Alternative 14: 57.2% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -650000 \lor \neg \left(y \leq 1.85 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x}{1 + \frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.5e5 or 1.8499999999999999e25 < y

    1. Initial program 7.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. Step-by-step derivation
      1. clear-num7.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}}} \]
      2. inv-pow7.1%

        \[\leadsto \color{blue}{{\left(\frac{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}\right)}^{-1}} \]
    4. Applied egg-rr7.1%

      \[\leadsto \color{blue}{{\left(\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-17.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(x, y, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
      2. fma-undefine7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{x \cdot y + z}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      3. *-commutative7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{y \cdot x} + z, 27464.7644705\right), 230661.510616\right), t\right)}} \]
      4. fma-define7.1%

        \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(y, x, z\right)}, 27464.7644705\right), 230661.510616\right), t\right)}} \]
    6. Simplified7.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, y + a, b\right), c\right), i\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, x, z\right), 27464.7644705\right), 230661.510616\right), t\right)}}} \]
    7. Taylor expanded in y around inf 49.5%

      \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{x} + \frac{a}{x \cdot y}\right) - \frac{z}{{x}^{2} \cdot y}}} \]
    8. Taylor expanded in x around inf 62.8%

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

    if -6.5e5 < y < 1.8499999999999999e25

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

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

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

Alternative 15: 51.3% accurate, 2.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.40000000000000007e39 or 3.5000000000000002e39 < y

    1. Initial program 3.3%

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

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

    if -5.40000000000000007e39 < y < 3.5000000000000002e39

    1. Initial program 97.0%

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

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

Alternative 16: 26.1% accurate, 33.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 54.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 27.6%

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

Reproduce

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