Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2

Percentage Accurate: 55.8% → 83.4%
Time: 1.1min
Alternatives: 17
Speedup: 2.0×

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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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}

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 17 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 55.8% 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 83.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right)\\
t_2 := \mathsf{fma}\left(y, t\_1, i\right)\\
\mathbf{if}\;\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} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), \frac{y}{t\_2}, \frac{27464.7644705}{t\_2}\right), \frac{\mathsf{fma}\left(y, 230661.510616, t\right)}{\mathsf{fma}\left(t\_1, y, i\right)}\right)\\

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


\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 55.8%

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

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

      \[\leadsto \mathsf{fma}\left(y \cdot y, \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), \frac{y}{\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), i\right)}, \frac{27464.7644705}{\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), i\right)}\right)}, \frac{\mathsf{fma}\left(y, 230661.510616, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\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 55.8%

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

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

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

Alternative 2: 82.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)\\
\mathbf{if}\;\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} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{t\_1}, y, \frac{t}{t\_1}\right)\\

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


\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 55.8%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}, y, \frac{t}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\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 55.8%

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

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

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

Alternative 3: 81.9% accurate, 0.5× speedup?

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

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

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


\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 55.8%

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

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

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

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

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

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

Alternative 4: 81.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\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} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y \cdot y, \mathsf{fma}\left(y, 230661.510616, t\right)\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), i\right)}\\

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


\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 55.8%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y \cdot y, \mathsf{fma}\left(y, 230661.510616, t\right)\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), i\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 55.8%

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

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

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

Alternative 5: 81.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\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} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, 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)}\\

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


\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 55.8%

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

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

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

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

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

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

Alternative 6: 78.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -6.4 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{+35}:\\ \;\;\;\;\frac{\left(\left(z \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(a \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -6.4e+46)
     t_1
     (if (<= y 7.4e+35)
       (/
        (+ (* (+ (* (+ (* z y) 27464.7644705) y) 230661.510616) y) t)
        (+ (* (+ (* (+ (* a y) b) y) c) y) i))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -6.4e+46) {
		tmp = t_1;
	} else if (y <= 7.4e+35) {
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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 = (x + (z / y)) - ((a * x) / y)
    if (y <= (-6.4d+46)) then
        tmp = t_1
    else if (y <= 7.4d+35) then
        tmp = ((((((z * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -6.4e+46) {
		tmp = t_1;
	} else if (y <= 7.4e+35) {
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + (z / y)) - ((a * x) / y)
	tmp = 0
	if y <= -6.4e+46:
		tmp = t_1
	elif y <= 7.4e+35:
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -6.4e+46)
		tmp = t_1;
	elseif (y <= 7.4e+35)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(a * y) + b) * y) + c) * y) + i));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + (z / y)) - ((a * x) / y);
	tmp = 0.0;
	if (y <= -6.4e+46)
		tmp = t_1;
	elseif (y <= 7.4e+35)
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.4e+46], t$95$1, If[LessEqual[y, 7.4e+35], N[(N[(N[(N[(N[(N[(N[(z * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(a * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.3999999999999996e46 or 7.4e35 < y

    1. Initial program 55.8%

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

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

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

    if -6.3999999999999996e46 < y < 7.4e35

    1. Initial program 55.8%

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

      \[\leadsto \frac{\left(\left(\color{blue}{z} \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    3. Applied rewrites52.3%

      \[\leadsto \frac{\left(\left(\color{blue}{z} \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} \]
    4. Taylor expanded in y around 0

      \[\leadsto \frac{\left(\left(z \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\color{blue}{a} \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Applied rewrites51.2%

      \[\leadsto \frac{\left(\left(z \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} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 78.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -9000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+35}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y \cdot y, \mathsf{fma}\left(y, 230661.510616, t\right)\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(b, y, c\right), i\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -9000000000.0)
     t_1
     (if (<= y 1.95e+35)
       (/
        (fma (fma (fma y x z) y 27464.7644705) (* y y) (fma y 230661.510616 t))
        (fma y (fma b y c) i))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -9000000000.0) {
		tmp = t_1;
	} else if (y <= 1.95e+35) {
		tmp = fma(fma(fma(y, x, z), y, 27464.7644705), (y * y), fma(y, 230661.510616, t)) / fma(y, fma(b, y, c), i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -9000000000.0)
		tmp = t_1;
	elseif (y <= 1.95e+35)
		tmp = Float64(fma(fma(fma(y, x, z), y, 27464.7644705), Float64(y * y), fma(y, 230661.510616, t)) / fma(y, fma(b, y, c), i));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9000000000.0], t$95$1, If[LessEqual[y, 1.95e+35], N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * N[(y * y), $MachinePrecision] + N[(y * 230661.510616 + t), $MachinePrecision]), $MachinePrecision] / N[(y * N[(b * y + c), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -9000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{+35}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y \cdot y, \mathsf{fma}\left(y, 230661.510616, t\right)\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(b, y, c\right), i\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9e9 or 1.95e35 < y

    1. Initial program 55.8%

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

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

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

    if -9e9 < y < 1.95e35

    1. Initial program 55.8%

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, \frac{54929528941}{2000000}\right), y \cdot y, \mathsf{fma}\left(y, \frac{28832688827}{125000}, t\right)\right)}{\mathsf{fma}\left(y, \mathsf{fma}\left(\color{blue}{b}, y, c\right), i\right)} \]
    6. Applied rewrites51.0%

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

Alternative 8: 77.4% accurate, 0.5× speedup?

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

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

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


\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 55.8%

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

      \[\leadsto \frac{\left(\left(\color{blue}{z} \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    3. Applied rewrites52.3%

      \[\leadsto \frac{\left(\left(\color{blue}{z} \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} \]

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

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

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

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

Alternative 9: 75.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -9000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+35}:\\ \;\;\;\;\frac{\left(\left(z \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -9000000000.0)
     t_1
     (if (<= y 1.95e+35)
       (/
        (+ (* (+ (* (+ (* z y) 27464.7644705) y) 230661.510616) y) t)
        (+ (* (+ (* b y) c) y) i))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -9000000000.0) {
		tmp = t_1;
	} else if (y <= 1.95e+35) {
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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 = (x + (z / y)) - ((a * x) / y)
    if (y <= (-9000000000.0d0)) then
        tmp = t_1
    else if (y <= 1.95d+35) then
        tmp = ((((((z * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / ((((b * y) + c) * y) + i)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -9000000000.0) {
		tmp = t_1;
	} else if (y <= 1.95e+35) {
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + (z / y)) - ((a * x) / y)
	tmp = 0
	if y <= -9000000000.0:
		tmp = t_1
	elif y <= 1.95e+35:
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -9000000000.0)
		tmp = t_1;
	elseif (y <= 1.95e+35)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + (z / y)) - ((a * x) / y);
	tmp = 0.0;
	if (y <= -9000000000.0)
		tmp = t_1;
	elseif (y <= 1.95e+35)
		tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9000000000.0], t$95$1, If[LessEqual[y, 1.95e+35], N[(N[(N[(N[(N[(N[(N[(z * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -9000000000:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9e9 or 1.95e35 < y

    1. Initial program 55.8%

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

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

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

    if -9e9 < y < 1.95e35

    1. Initial program 55.8%

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

      \[\leadsto \frac{\left(\left(\color{blue}{z} \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    3. Applied rewrites52.3%

      \[\leadsto \frac{\left(\left(\color{blue}{z} \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} \]
    4. Taylor expanded in y around 0

      \[\leadsto \frac{\left(\left(z \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\color{blue}{b \cdot y} + c\right) \cdot y + i} \]
    5. Applied rewrites48.5%

      \[\leadsto \frac{\left(\left(z \cdot y + 27464.7644705\right) \cdot y + 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. Add Preprocessing

Alternative 10: 74.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -9000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+35}:\\ \;\;\;\;\frac{\left(27464.7644705 \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(a \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -9000000000.0)
     t_1
     (if (<= y 2.25e+35)
       (/
        (+ (* (+ (* 27464.7644705 y) 230661.510616) y) t)
        (+ (* (+ (* (+ (* a y) b) y) c) y) i))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -9000000000.0) {
		tmp = t_1;
	} else if (y <= 2.25e+35) {
		tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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 = (x + (z / y)) - ((a * x) / y)
    if (y <= (-9000000000.0d0)) then
        tmp = t_1
    else if (y <= 2.25d+35) then
        tmp = ((((27464.7644705d0 * y) + 230661.510616d0) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -9000000000.0) {
		tmp = t_1;
	} else if (y <= 2.25e+35) {
		tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + (z / y)) - ((a * x) / y)
	tmp = 0
	if y <= -9000000000.0:
		tmp = t_1
	elif y <= 2.25e+35:
		tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -9000000000.0)
		tmp = t_1;
	elseif (y <= 2.25e+35)
		tmp = Float64(Float64(Float64(Float64(Float64(27464.7644705 * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(a * y) + b) * y) + c) * y) + i));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + (z / y)) - ((a * x) / y);
	tmp = 0.0;
	if (y <= -9000000000.0)
		tmp = t_1;
	elseif (y <= 2.25e+35)
		tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9000000000.0], t$95$1, If[LessEqual[y, 2.25e+35], N[(N[(N[(N[(N[(27464.7644705 * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(a * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -9000000000:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9e9 or 2.2499999999999998e35 < y

    1. Initial program 55.8%

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

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

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

    if -9e9 < y < 2.2499999999999998e35

    1. Initial program 55.8%

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

      \[\leadsto \frac{\left(\left(\color{blue}{z} \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    3. Applied rewrites52.3%

      \[\leadsto \frac{\left(\left(\color{blue}{z} \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} \]
    4. Taylor expanded in y around 0

      \[\leadsto \frac{\left(\left(z \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\color{blue}{a} \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Applied rewrites51.2%

      \[\leadsto \frac{\left(\left(z \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} \]
    6. Taylor expanded in y around 0

      \[\leadsto \frac{\left(\color{blue}{\frac{54929528941}{2000000} \cdot y} + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(a \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    7. Applied rewrites47.3%

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

Alternative 11: 73.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -1150000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+34}:\\ \;\;\;\;\frac{230661.510616 \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -1150000000.0)
     t_1
     (if (<= y 3.5e+34)
       (/
        (+ (* 230661.510616 y) t)
        (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -1150000000.0) {
		tmp = t_1;
	} else if (y <= 3.5e+34) {
		tmp = ((230661.510616 * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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 = (x + (z / y)) - ((a * x) / y)
    if (y <= (-1150000000.0d0)) then
        tmp = t_1
    else if (y <= 3.5d+34) then
        tmp = ((230661.510616d0 * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -1150000000.0) {
		tmp = t_1;
	} else if (y <= 3.5e+34) {
		tmp = ((230661.510616 * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + (z / y)) - ((a * x) / y)
	tmp = 0
	if y <= -1150000000.0:
		tmp = t_1
	elif y <= 3.5e+34:
		tmp = ((230661.510616 * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -1150000000.0)
		tmp = t_1;
	elseif (y <= 3.5e+34)
		tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + (z / y)) - ((a * x) / y);
	tmp = 0.0;
	if (y <= -1150000000.0)
		tmp = t_1;
	elseif (y <= 3.5e+34)
		tmp = ((230661.510616 * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1150000000.0], t$95$1, If[LessEqual[y, 3.5e+34], N[(N[(N[(230661.510616 * 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], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1150000000:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.15e9 or 3.49999999999999998e34 < y

    1. Initial program 55.8%

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

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

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

    if -1.15e9 < y < 3.49999999999999998e34

    1. Initial program 55.8%

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

      \[\leadsto \frac{\color{blue}{\frac{28832688827}{125000}} \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    3. Applied rewrites47.9%

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

Alternative 12: 73.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -1150000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+34}:\\ \;\;\;\;\frac{230661.510616 \cdot y + t}{\left(\left(a \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -1150000000.0)
     t_1
     (if (<= y 3.5e+34)
       (/ (+ (* 230661.510616 y) t) (+ (* (+ (* (+ (* a y) b) y) c) y) i))
       t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -1150000000.0) {
		tmp = t_1;
	} else if (y <= 3.5e+34) {
		tmp = ((230661.510616 * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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 = (x + (z / y)) - ((a * x) / y)
    if (y <= (-1150000000.0d0)) then
        tmp = t_1
    else if (y <= 3.5d+34) then
        tmp = ((230661.510616d0 * y) + t) / ((((((a * y) + b) * y) + c) * y) + i)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -1150000000.0) {
		tmp = t_1;
	} else if (y <= 3.5e+34) {
		tmp = ((230661.510616 * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x + (z / y)) - ((a * x) / y)
	tmp = 0
	if y <= -1150000000.0:
		tmp = t_1
	elif y <= 3.5e+34:
		tmp = ((230661.510616 * y) + t) / ((((((a * y) + b) * y) + c) * y) + i)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -1150000000.0)
		tmp = t_1;
	elseif (y <= 3.5e+34)
		tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(a * y) + b) * y) + c) * y) + i));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x + (z / y)) - ((a * x) / y);
	tmp = 0.0;
	if (y <= -1150000000.0)
		tmp = t_1;
	elseif (y <= 3.5e+34)
		tmp = ((230661.510616 * y) + t) / ((((((a * y) + b) * y) + c) * y) + i);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1150000000.0], t$95$1, If[LessEqual[y, 3.5e+34], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(a * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1150000000:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.15e9 or 3.49999999999999998e34 < y

    1. Initial program 55.8%

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

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

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

    if -1.15e9 < y < 3.49999999999999998e34

    1. Initial program 55.8%

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

      \[\leadsto \frac{\left(\left(\color{blue}{z} \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    3. Applied rewrites52.3%

      \[\leadsto \frac{\left(\left(\color{blue}{z} \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} \]
    4. Taylor expanded in y around 0

      \[\leadsto \frac{\left(\left(z \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\color{blue}{a} \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    5. Applied rewrites51.2%

      \[\leadsto \frac{\left(\left(z \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} \]
    6. Taylor expanded in y around 0

      \[\leadsto \frac{\color{blue}{\frac{28832688827}{125000}} \cdot y + t}{\left(\left(a \cdot y + b\right) \cdot y + c\right) \cdot y + i} \]
    7. Applied rewrites47.5%

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

Alternative 13: 66.7% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -9000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{+25}:\\ \;\;\;\;\frac{t}{\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), i\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -9000000000.0)
     t_1
     (if (<= y 7.4e+25) (/ t (fma y (fma (fma (+ y a) y b) y c) i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -9000000000.0) {
		tmp = t_1;
	} else if (y <= 7.4e+25) {
		tmp = t / fma(y, fma(fma((y + a), y, b), y, c), i);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -9000000000.0)
		tmp = t_1;
	elseif (y <= 7.4e+25)
		tmp = Float64(t / fma(y, fma(fma(Float64(y + a), y, b), y, c), i));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9000000000.0], t$95$1, If[LessEqual[y, 7.4e+25], N[(t / N[(y * N[(N[(N[(y + a), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -9000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{+25}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), i\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9e9 or 7.3999999999999998e25 < y

    1. Initial program 55.8%

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

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

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

    if -9e9 < y < 7.3999999999999998e25

    1. Initial program 55.8%

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

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

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

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

      \[\leadsto \frac{\color{blue}{t}}{\mathsf{fma}\left(y, \mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), i\right)} \]
    6. Applied rewrites40.8%

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

Alternative 14: 58.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\ \mathbf{if}\;y \leq -2050000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{+25}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{230661.510616}{i}, \frac{t}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
   (if (<= y -2050000000.0)
     t_1
     (if (<= y 7.4e+25) (fma y (/ 230661.510616 i) (/ t i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x + (z / y)) - ((a * x) / y);
	double tmp;
	if (y <= -2050000000.0) {
		tmp = t_1;
	} else if (y <= 7.4e+25) {
		tmp = fma(y, (230661.510616 / i), (t / i));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y))
	tmp = 0.0
	if (y <= -2050000000.0)
		tmp = t_1;
	elseif (y <= 7.4e+25)
		tmp = fma(y, Float64(230661.510616 / i), Float64(t / i));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2050000000.0], t$95$1, If[LessEqual[y, 7.4e+25], N[(y * N[(230661.510616 / i), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -2050000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{230661.510616}{i}, \frac{t}{i}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.05e9 or 7.3999999999999998e25 < y

    1. Initial program 55.8%

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

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

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

    if -2.05e9 < y < 7.3999999999999998e25

    1. Initial program 55.8%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{28832688827}{125000} \cdot \frac{1}{i} - \frac{c \cdot t}{{i}^{2}}\right) + \frac{t}{i}} \]
    3. Applied rewrites25.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, 230661.510616 \cdot \frac{1}{i} - \frac{c \cdot t}{{i}^{2}}, \frac{t}{i}\right)} \]
    4. Taylor expanded in t around 0

      \[\leadsto \mathsf{fma}\left(y, \frac{\frac{28832688827}{125000}}{\color{blue}{i}}, \frac{t}{i}\right) \]
    5. Applied rewrites31.7%

      \[\leadsto \mathsf{fma}\left(y, \frac{230661.510616}{\color{blue}{i}}, \frac{t}{i}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 31.8% accurate, 3.1× speedup?

\[\begin{array}{l} \\ -1 \cdot \frac{\mathsf{fma}\left(-230661.510616, y, -1 \cdot t\right)}{i} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* -1.0 (/ (fma -230661.510616 y (* -1.0 t)) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return -1.0 * (fma(-230661.510616, y, (-1.0 * t)) / i);
}
function code(x, y, z, t, a, b, c, i)
	return Float64(-1.0 * Float64(fma(-230661.510616, y, Float64(-1.0 * t)) / i))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(-1.0 * N[(N[(-230661.510616 * y + N[(-1.0 * t), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
-1 \cdot \frac{\mathsf{fma}\left(-230661.510616, y, -1 \cdot t\right)}{i}
\end{array}
Derivation
  1. Initial program 55.8%

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

    \[\leadsto \color{blue}{y \cdot \left(\frac{28832688827}{125000} \cdot \frac{1}{i} - \frac{c \cdot t}{{i}^{2}}\right) + \frac{t}{i}} \]
  3. Applied rewrites25.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, 230661.510616 \cdot \frac{1}{i} - \frac{c \cdot t}{{i}^{2}}, \frac{t}{i}\right)} \]
  4. Taylor expanded in i around -inf

    \[\leadsto -1 \cdot \color{blue}{\frac{\frac{-28832688827}{125000} \cdot y + -1 \cdot t}{i}} \]
  5. Applied rewrites31.8%

    \[\leadsto -1 \cdot \color{blue}{\frac{\mathsf{fma}\left(-230661.510616, y, -1 \cdot t\right)}{i}} \]
  6. Add Preprocessing

Alternative 16: 31.8% accurate, 4.7× speedup?

\[\begin{array}{l} \\ \frac{t + 230661.510616 \cdot y}{i} \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (/ (+ t (* 230661.510616 y)) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (t + (230661.510616 * y)) / i;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
    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 = (t + (230661.510616d0 * 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 (t + (230661.510616 * y)) / i;
}
def code(x, y, z, t, a, b, c, i):
	return (t + (230661.510616 * y)) / i
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(t + Float64(230661.510616 * y)) / i)
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (t + (230661.510616 * y)) / i;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + N[(230661.510616 * y), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]
\begin{array}{l}

\\
\frac{t + 230661.510616 \cdot y}{i}
\end{array}
Derivation
  1. Initial program 55.8%

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

    \[\leadsto \color{blue}{y \cdot \left(\frac{28832688827}{125000} \cdot \frac{1}{i} - \frac{c \cdot t}{{i}^{2}}\right) + \frac{t}{i}} \]
  3. Applied rewrites25.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, 230661.510616 \cdot \frac{1}{i} - \frac{c \cdot t}{{i}^{2}}, \frac{t}{i}\right)} \]
  4. Taylor expanded in t around 0

    \[\leadsto \frac{28832688827}{125000} \cdot \color{blue}{\frac{y}{i}} \]
  5. Applied rewrites10.0%

    \[\leadsto 230661.510616 \cdot \color{blue}{\frac{y}{i}} \]
  6. Applied rewrites10.1%

    \[\leadsto y \cdot \frac{230661.510616}{\color{blue}{i}} \]
  7. Taylor expanded in i around inf

    \[\leadsto \frac{t + \frac{28832688827}{125000} \cdot y}{\color{blue}{i}} \]
  8. Applied rewrites31.8%

    \[\leadsto \frac{t + 230661.510616 \cdot y}{\color{blue}{i}} \]
  9. Add Preprocessing

Alternative 17: 28.7% accurate, 10.8× speedup?

\[\begin{array}{l} \\ \frac{t}{i} \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (/ t i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return t / i;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\\
\frac{t}{i}
\end{array}
Derivation
  1. Initial program 55.8%

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

    \[\leadsto \color{blue}{\frac{t}{i}} \]
  3. Applied rewrites28.7%

    \[\leadsto \color{blue}{\frac{t}{i}} \]
  4. Add Preprocessing

Reproduce

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