Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F

Percentage Accurate: 78.5% → 99.5%
Time: 4.4s
Alternatives: 7
Speedup: 7.2×

Specification

?
\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
(FPCore (x y)
  :precision binary64
  (/ (exp (* x (log (/ x (+ x y))))) x))
double code(double x, double y) {
	return exp((x * log((x / (x + y))))) / x;
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = exp((x * log((x / (x + y))))) / x
end function
public static double code(double x, double y) {
	return Math.exp((x * Math.log((x / (x + y))))) / x;
}
def code(x, y):
	return math.exp((x * math.log((x / (x + y))))) / x
function code(x, y)
	return Float64(exp(Float64(x * log(Float64(x / Float64(x + y))))) / x)
end
function tmp = code(x, y)
	tmp = exp((x * log((x / (x + y))))) / x;
end
code[x_, y_] := N[(N[Exp[N[(x * N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}

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 7 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: 78.5% accurate, 1.0× speedup?

\[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
(FPCore (x y)
  :precision binary64
  (/ (exp (* x (log (/ x (+ x y))))) x))
double code(double x, double y) {
	return exp((x * log((x / (x + y))))) / x;
}
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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = exp((x * log((x / (x + y))))) / x
end function
public static double code(double x, double y) {
	return Math.exp((x * Math.log((x / (x + y))))) / x;
}
def code(x, y):
	return math.exp((x * math.log((x / (x + y))))) / x
function code(x, y)
	return Float64(exp(Float64(x * log(Float64(x / Float64(x + y))))) / x)
end
function tmp = code(x, y)
	tmp = exp((x * log((x / (x + y))))) / x;
end
code[x_, y_] := N[(N[Exp[N[(x * N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}

Alternative 1: 99.5% accurate, 1.8× speedup?

\[\begin{array}{l} t_0 := \frac{e^{-y}}{x}\\ \mathbf{if}\;x \leq -3.9:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 3.2:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (/ (exp (- y)) x)))
  (if (<= x -3.9) t_0 (if (<= x 3.2) (/ 1.0 x) t_0))))
double code(double x, double y) {
	double t_0 = exp(-y) / x;
	double tmp;
	if (x <= -3.9) {
		tmp = t_0;
	} else if (x <= 3.2) {
		tmp = 1.0 / x;
	} else {
		tmp = t_0;
	}
	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)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = exp(-y) / x
    if (x <= (-3.9d0)) then
        tmp = t_0
    else if (x <= 3.2d0) then
        tmp = 1.0d0 / x
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = Math.exp(-y) / x;
	double tmp;
	if (x <= -3.9) {
		tmp = t_0;
	} else if (x <= 3.2) {
		tmp = 1.0 / x;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = math.exp(-y) / x
	tmp = 0
	if x <= -3.9:
		tmp = t_0
	elif x <= 3.2:
		tmp = 1.0 / x
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(exp(Float64(-y)) / x)
	tmp = 0.0
	if (x <= -3.9)
		tmp = t_0;
	elseif (x <= 3.2)
		tmp = Float64(1.0 / x);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = exp(-y) / x;
	tmp = 0.0;
	if (x <= -3.9)
		tmp = t_0;
	elseif (x <= 3.2)
		tmp = 1.0 / x;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Exp[(-y)], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[x, -3.9], t$95$0, If[LessEqual[x, 3.2], N[(1.0 / x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{e^{-y}}{x}\\
\mathbf{if}\;x \leq -3.9:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 3.2:\\
\;\;\;\;\frac{1}{x}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.8999999999999999 or 3.2000000000000002 < x

    1. Initial program 78.5%

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
    2. Taylor expanded in x around inf

      \[\leadsto \frac{e^{\color{blue}{-1 \cdot y}}}{x} \]
    3. Step-by-step derivation
      1. lower-*.f6483.2%

        \[\leadsto \frac{e^{-1 \cdot \color{blue}{y}}}{x} \]
    4. Applied rewrites83.2%

      \[\leadsto \frac{e^{\color{blue}{-1 \cdot y}}}{x} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{e^{-1 \cdot \color{blue}{y}}}{x} \]
      2. mul-1-negN/A

        \[\leadsto \frac{e^{\mathsf{neg}\left(y\right)}}{x} \]
      3. lower-neg.f6483.2%

        \[\leadsto \frac{e^{-y}}{x} \]
    6. Applied rewrites83.2%

      \[\leadsto \frac{e^{-y}}{x} \]

    if -3.8999999999999999 < x < 3.2000000000000002

    1. Initial program 78.5%

      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
    2. Taylor expanded in x around 0

      \[\leadsto \frac{\color{blue}{1}}{x} \]
    3. Step-by-step derivation
      1. Applied rewrites75.3%

        \[\leadsto \frac{\color{blue}{1}}{x} \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 2: 85.9% accurate, 2.6× speedup?

    \[\begin{array}{l} t_0 := \frac{1}{x + y \cdot \left(-1 \cdot \left(y \cdot \left(-1 \cdot x + x \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right)\right)\right) - -1 \cdot x\right)}\\ \mathbf{if}\;x \leq -5.2 \cdot 10^{+138}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -4:\\ \;\;\;\;\frac{\frac{\left(\left(1 - y\right) \cdot x\right) \cdot x}{x \cdot x}}{x}\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-17}:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
    (FPCore (x y)
      :precision binary64
      (let* ((t_0
            (/
             1.0
             (+
              x
              (*
               y
               (-
                (*
                 -1.0
                 (* y (+ (* -1.0 x) (* x (+ 0.5 (* 0.5 (/ 1.0 x)))))))
                (* -1.0 x)))))))
      (if (<= x -5.2e+138)
        t_0
        (if (<= x -4.0)
          (/ (/ (* (* (- 1.0 y) x) x) (* x x)) x)
          (if (<= x 3.2e-17) (/ 1.0 x) t_0)))))
    double code(double x, double y) {
    	double t_0 = 1.0 / (x + (y * ((-1.0 * (y * ((-1.0 * x) + (x * (0.5 + (0.5 * (1.0 / x))))))) - (-1.0 * x))));
    	double tmp;
    	if (x <= -5.2e+138) {
    		tmp = t_0;
    	} else if (x <= -4.0) {
    		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x;
    	} else if (x <= 3.2e-17) {
    		tmp = 1.0 / x;
    	} else {
    		tmp = t_0;
    	}
    	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)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8) :: t_0
        real(8) :: tmp
        t_0 = 1.0d0 / (x + (y * (((-1.0d0) * (y * (((-1.0d0) * x) + (x * (0.5d0 + (0.5d0 * (1.0d0 / x))))))) - ((-1.0d0) * x))))
        if (x <= (-5.2d+138)) then
            tmp = t_0
        else if (x <= (-4.0d0)) then
            tmp = ((((1.0d0 - y) * x) * x) / (x * x)) / x
        else if (x <= 3.2d-17) then
            tmp = 1.0d0 / x
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double t_0 = 1.0 / (x + (y * ((-1.0 * (y * ((-1.0 * x) + (x * (0.5 + (0.5 * (1.0 / x))))))) - (-1.0 * x))));
    	double tmp;
    	if (x <= -5.2e+138) {
    		tmp = t_0;
    	} else if (x <= -4.0) {
    		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x;
    	} else if (x <= 3.2e-17) {
    		tmp = 1.0 / x;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = 1.0 / (x + (y * ((-1.0 * (y * ((-1.0 * x) + (x * (0.5 + (0.5 * (1.0 / x))))))) - (-1.0 * x))))
    	tmp = 0
    	if x <= -5.2e+138:
    		tmp = t_0
    	elif x <= -4.0:
    		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x
    	elif x <= 3.2e-17:
    		tmp = 1.0 / x
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(1.0 / Float64(x + Float64(y * Float64(Float64(-1.0 * Float64(y * Float64(Float64(-1.0 * x) + Float64(x * Float64(0.5 + Float64(0.5 * Float64(1.0 / x))))))) - Float64(-1.0 * x)))))
    	tmp = 0.0
    	if (x <= -5.2e+138)
    		tmp = t_0;
    	elseif (x <= -4.0)
    		tmp = Float64(Float64(Float64(Float64(Float64(1.0 - y) * x) * x) / Float64(x * x)) / x);
    	elseif (x <= 3.2e-17)
    		tmp = Float64(1.0 / x);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = 1.0 / (x + (y * ((-1.0 * (y * ((-1.0 * x) + (x * (0.5 + (0.5 * (1.0 / x))))))) - (-1.0 * x))));
    	tmp = 0.0;
    	if (x <= -5.2e+138)
    		tmp = t_0;
    	elseif (x <= -4.0)
    		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x;
    	elseif (x <= 3.2e-17)
    		tmp = 1.0 / x;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(y * N[(N[(-1.0 * N[(y * N[(N[(-1.0 * x), $MachinePrecision] + N[(x * N[(0.5 + N[(0.5 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e+138], t$95$0, If[LessEqual[x, -4.0], N[(N[(N[(N[(N[(1.0 - y), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 3.2e-17], N[(1.0 / x), $MachinePrecision], t$95$0]]]]
    
    \begin{array}{l}
    t_0 := \frac{1}{x + y \cdot \left(-1 \cdot \left(y \cdot \left(-1 \cdot x + x \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right)\right)\right) - -1 \cdot x\right)}\\
    \mathbf{if}\;x \leq -5.2 \cdot 10^{+138}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq -4:\\
    \;\;\;\;\frac{\frac{\left(\left(1 - y\right) \cdot x\right) \cdot x}{x \cdot x}}{x}\\
    
    \mathbf{elif}\;x \leq 3.2 \cdot 10^{-17}:\\
    \;\;\;\;\frac{1}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -5.2000000000000002e138 or 3.2000000000000002e-17 < x

      1. Initial program 78.5%

        \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
      2. Taylor expanded in y around 0

        \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

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

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

          \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - \color{blue}{1}\right)}{x} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
        5. lower-+.f64N/A

          \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
        7. lower-/.f6460.2%

          \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}{x} \]
      4. Applied rewrites60.2%

        \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x}} \]
        2. div-flipN/A

          \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
        3. lower-unsound-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
        4. lower-unsound-/.f6460.2%

          \[\leadsto \frac{1}{\color{blue}{\frac{x}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}} \]
        5. lift-+.f64N/A

          \[\leadsto \frac{1}{\frac{x}{1 + \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
        6. +-commutativeN/A

          \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) + \color{blue}{1}}} \]
        7. add-flipN/A

          \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}} \]
        8. metadata-evalN/A

          \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - -1}} \]
        9. lower--.f6460.2%

          \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{-1}}} \]
      6. Applied rewrites60.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\left(\frac{0.5}{x} - -0.5\right) \cdot y - 1\right) \cdot y - -1}}} \]
      7. Taylor expanded in x around inf

        \[\leadsto \frac{1}{\frac{x}{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}} \]
      8. Step-by-step derivation
        1. Applied rewrites64.4%

          \[\leadsto \frac{1}{\frac{x}{\left(0.5 \cdot y - 1\right) \cdot y - -1}} \]
        2. Taylor expanded in y around 0

          \[\leadsto \frac{1}{\color{blue}{x + y \cdot \left(-1 \cdot \left(y \cdot \left(-1 \cdot x + x \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right)\right)\right) - -1 \cdot x\right)}} \]
        3. Step-by-step derivation
          1. lower-+.f64N/A

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

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

            \[\leadsto \frac{1}{x + y \cdot \left(-1 \cdot \left(y \cdot \left(-1 \cdot x + x \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right)\right)\right) - \color{blue}{-1 \cdot x}\right)} \]
        4. Applied rewrites63.9%

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

        if -5.2000000000000002e138 < x < -4

        1. Initial program 78.5%

          \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
        2. Taylor expanded in y around 0

          \[\leadsto \frac{\color{blue}{1 + -1 \cdot y}}{x} \]
        3. Step-by-step derivation
          1. lower-+.f64N/A

            \[\leadsto \frac{1 + \color{blue}{-1 \cdot y}}{x} \]
          2. lower-*.f6459.1%

            \[\leadsto \frac{1 + -1 \cdot \color{blue}{y}}{x} \]
        4. Applied rewrites59.1%

          \[\leadsto \frac{\color{blue}{1 + -1 \cdot y}}{x} \]
        5. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \frac{1 + \color{blue}{-1 \cdot y}}{x} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{1 + -1 \cdot \color{blue}{y}}{x} \]
          3. mul-1-negN/A

            \[\leadsto \frac{1 + \left(\mathsf{neg}\left(y\right)\right)}{x} \]
          4. sub-flip-reverseN/A

            \[\leadsto \frac{1 - \color{blue}{y}}{x} \]
          5. lower--.f6459.1%

            \[\leadsto \frac{1 - \color{blue}{y}}{x} \]
        6. Applied rewrites59.1%

          \[\leadsto \frac{1 - \color{blue}{y}}{x} \]
        7. Step-by-step derivation
          1. remove-double-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)}{x} \]
          2. lift--.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)}{x} \]
          3. sub-negate-revN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - 1\right)\right)}{x} \]
          4. *-inversesN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - \frac{x}{x}\right)\right)}{x} \]
          5. sub-to-fraction-revN/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{y \cdot x - x}{x}\right)}{x} \]
          6. *-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{x \cdot y - x}{x}\right)}{x} \]
          7. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{x \cdot y - x}{x}\right)}{x} \]
          8. sub-negate-revN/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{x}\right)}{x} \]
          9. lift--.f64N/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{x}\right)}{x} \]
          10. remove-double-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)}\right)}{x} \]
          11. frac-2negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{x - x \cdot y}{\mathsf{neg}\left(x\right)}\right)}{x} \]
          12. distribute-frac-negN/A

            \[\leadsto \frac{\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{\color{blue}{\mathsf{neg}\left(x\right)}}}{x} \]
          13. frac-2negN/A

            \[\leadsto \frac{\frac{x - x \cdot y}{\color{blue}{x}}}{x} \]
          14. mult-flipN/A

            \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \color{blue}{\frac{1}{x}}}{x} \]
          15. *-inversesN/A

            \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \frac{\frac{x}{x}}{x}}{x} \]
          16. associate-/r*N/A

            \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \frac{x}{\color{blue}{x \cdot x}}}{x} \]
          17. lift-*.f64N/A

            \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \frac{x}{x \cdot \color{blue}{x}}}{x} \]
          18. associate-*r/N/A

            \[\leadsto \frac{\frac{\left(x - x \cdot y\right) \cdot x}{\color{blue}{x \cdot x}}}{x} \]
          19. lower-/.f64N/A

            \[\leadsto \frac{\frac{\left(x - x \cdot y\right) \cdot x}{\color{blue}{x \cdot x}}}{x} \]
        8. Applied rewrites34.6%

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

        if -4 < x < 3.2000000000000002e-17

        1. Initial program 78.5%

          \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
        2. Taylor expanded in x around 0

          \[\leadsto \frac{\color{blue}{1}}{x} \]
        3. Step-by-step derivation
          1. Applied rewrites75.3%

            \[\leadsto \frac{\color{blue}{1}}{x} \]
        4. Recombined 3 regimes into one program.
        5. Add Preprocessing

        Alternative 3: 84.2% accurate, 4.4× speedup?

        \[\begin{array}{l} t_0 := \frac{1}{x + x \cdot y}\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{+150}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -4:\\ \;\;\;\;\frac{\frac{\left(\left(1 - y\right) \cdot x\right) \cdot x}{x \cdot x}}{x}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (let* ((t_0 (/ 1.0 (+ x (* x y)))))
          (if (<= x -7.5e+150)
            t_0
            (if (<= x -4.0)
              (/ (/ (* (* (- 1.0 y) x) x) (* x x)) x)
              (if (<= x 1.1e-11) (/ 1.0 x) t_0)))))
        double code(double x, double y) {
        	double t_0 = 1.0 / (x + (x * y));
        	double tmp;
        	if (x <= -7.5e+150) {
        		tmp = t_0;
        	} else if (x <= -4.0) {
        		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x;
        	} else if (x <= 1.1e-11) {
        		tmp = 1.0 / x;
        	} else {
        		tmp = t_0;
        	}
        	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)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8) :: t_0
            real(8) :: tmp
            t_0 = 1.0d0 / (x + (x * y))
            if (x <= (-7.5d+150)) then
                tmp = t_0
            else if (x <= (-4.0d0)) then
                tmp = ((((1.0d0 - y) * x) * x) / (x * x)) / x
            else if (x <= 1.1d-11) then
                tmp = 1.0d0 / x
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double t_0 = 1.0 / (x + (x * y));
        	double tmp;
        	if (x <= -7.5e+150) {
        		tmp = t_0;
        	} else if (x <= -4.0) {
        		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x;
        	} else if (x <= 1.1e-11) {
        		tmp = 1.0 / x;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	t_0 = 1.0 / (x + (x * y))
        	tmp = 0
        	if x <= -7.5e+150:
        		tmp = t_0
        	elif x <= -4.0:
        		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x
        	elif x <= 1.1e-11:
        		tmp = 1.0 / x
        	else:
        		tmp = t_0
        	return tmp
        
        function code(x, y)
        	t_0 = Float64(1.0 / Float64(x + Float64(x * y)))
        	tmp = 0.0
        	if (x <= -7.5e+150)
        		tmp = t_0;
        	elseif (x <= -4.0)
        		tmp = Float64(Float64(Float64(Float64(Float64(1.0 - y) * x) * x) / Float64(x * x)) / x);
        	elseif (x <= 1.1e-11)
        		tmp = Float64(1.0 / x);
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	t_0 = 1.0 / (x + (x * y));
        	tmp = 0.0;
        	if (x <= -7.5e+150)
        		tmp = t_0;
        	elseif (x <= -4.0)
        		tmp = ((((1.0 - y) * x) * x) / (x * x)) / x;
        	elseif (x <= 1.1e-11)
        		tmp = 1.0 / x;
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e+150], t$95$0, If[LessEqual[x, -4.0], N[(N[(N[(N[(N[(1.0 - y), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1.1e-11], N[(1.0 / x), $MachinePrecision], t$95$0]]]]
        
        \begin{array}{l}
        t_0 := \frac{1}{x + x \cdot y}\\
        \mathbf{if}\;x \leq -7.5 \cdot 10^{+150}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq -4:\\
        \;\;\;\;\frac{\frac{\left(\left(1 - y\right) \cdot x\right) \cdot x}{x \cdot x}}{x}\\
        
        \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\
        \;\;\;\;\frac{1}{x}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if x < -7.4999999999999998e150 or 1.1000000000000001e-11 < x

          1. Initial program 78.5%

            \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
          2. Taylor expanded in y around 0

            \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
          3. Step-by-step derivation
            1. lower-+.f64N/A

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

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

              \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - \color{blue}{1}\right)}{x} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
            5. lower-+.f64N/A

              \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
            6. lower-*.f64N/A

              \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
            7. lower-/.f6460.2%

              \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}{x} \]
          4. Applied rewrites60.2%

            \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
          5. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x}} \]
            2. div-flipN/A

              \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
            3. lower-unsound-/.f64N/A

              \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
            4. lower-unsound-/.f6460.2%

              \[\leadsto \frac{1}{\color{blue}{\frac{x}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}} \]
            5. lift-+.f64N/A

              \[\leadsto \frac{1}{\frac{x}{1 + \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
            6. +-commutativeN/A

              \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) + \color{blue}{1}}} \]
            7. add-flipN/A

              \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}} \]
            8. metadata-evalN/A

              \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - -1}} \]
            9. lower--.f6460.2%

              \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{-1}}} \]
          6. Applied rewrites60.2%

            \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\left(\frac{0.5}{x} - -0.5\right) \cdot y - 1\right) \cdot y - -1}}} \]
          7. Taylor expanded in y around 0

            \[\leadsto \frac{1}{\color{blue}{x + x \cdot y}} \]
          8. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \frac{1}{x + \color{blue}{x \cdot y}} \]
            2. lower-*.f6465.3%

              \[\leadsto \frac{1}{x + x \cdot \color{blue}{y}} \]
          9. Applied rewrites65.3%

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

          if -7.4999999999999998e150 < x < -4

          1. Initial program 78.5%

            \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
          2. Taylor expanded in y around 0

            \[\leadsto \frac{\color{blue}{1 + -1 \cdot y}}{x} \]
          3. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \frac{1 + \color{blue}{-1 \cdot y}}{x} \]
            2. lower-*.f6459.1%

              \[\leadsto \frac{1 + -1 \cdot \color{blue}{y}}{x} \]
          4. Applied rewrites59.1%

            \[\leadsto \frac{\color{blue}{1 + -1 \cdot y}}{x} \]
          5. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \frac{1 + \color{blue}{-1 \cdot y}}{x} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{1 + -1 \cdot \color{blue}{y}}{x} \]
            3. mul-1-negN/A

              \[\leadsto \frac{1 + \left(\mathsf{neg}\left(y\right)\right)}{x} \]
            4. sub-flip-reverseN/A

              \[\leadsto \frac{1 - \color{blue}{y}}{x} \]
            5. lower--.f6459.1%

              \[\leadsto \frac{1 - \color{blue}{y}}{x} \]
          6. Applied rewrites59.1%

            \[\leadsto \frac{1 - \color{blue}{y}}{x} \]
          7. Step-by-step derivation
            1. remove-double-negN/A

              \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)}{x} \]
            2. lift--.f64N/A

              \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(1 - y\right)\right)\right)\right)}{x} \]
            3. sub-negate-revN/A

              \[\leadsto \frac{\mathsf{neg}\left(\left(y - 1\right)\right)}{x} \]
            4. *-inversesN/A

              \[\leadsto \frac{\mathsf{neg}\left(\left(y - \frac{x}{x}\right)\right)}{x} \]
            5. sub-to-fraction-revN/A

              \[\leadsto \frac{\mathsf{neg}\left(\frac{y \cdot x - x}{x}\right)}{x} \]
            6. *-commutativeN/A

              \[\leadsto \frac{\mathsf{neg}\left(\frac{x \cdot y - x}{x}\right)}{x} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{\mathsf{neg}\left(\frac{x \cdot y - x}{x}\right)}{x} \]
            8. sub-negate-revN/A

              \[\leadsto \frac{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{x}\right)}{x} \]
            9. lift--.f64N/A

              \[\leadsto \frac{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{x}\right)}{x} \]
            10. remove-double-negN/A

              \[\leadsto \frac{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)}\right)}{x} \]
            11. frac-2negN/A

              \[\leadsto \frac{\mathsf{neg}\left(\frac{x - x \cdot y}{\mathsf{neg}\left(x\right)}\right)}{x} \]
            12. distribute-frac-negN/A

              \[\leadsto \frac{\frac{\mathsf{neg}\left(\left(x - x \cdot y\right)\right)}{\color{blue}{\mathsf{neg}\left(x\right)}}}{x} \]
            13. frac-2negN/A

              \[\leadsto \frac{\frac{x - x \cdot y}{\color{blue}{x}}}{x} \]
            14. mult-flipN/A

              \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \color{blue}{\frac{1}{x}}}{x} \]
            15. *-inversesN/A

              \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \frac{\frac{x}{x}}{x}}{x} \]
            16. associate-/r*N/A

              \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \frac{x}{\color{blue}{x \cdot x}}}{x} \]
            17. lift-*.f64N/A

              \[\leadsto \frac{\left(x - x \cdot y\right) \cdot \frac{x}{x \cdot \color{blue}{x}}}{x} \]
            18. associate-*r/N/A

              \[\leadsto \frac{\frac{\left(x - x \cdot y\right) \cdot x}{\color{blue}{x \cdot x}}}{x} \]
            19. lower-/.f64N/A

              \[\leadsto \frac{\frac{\left(x - x \cdot y\right) \cdot x}{\color{blue}{x \cdot x}}}{x} \]
          8. Applied rewrites34.6%

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

          if -4 < x < 1.1000000000000001e-11

          1. Initial program 78.5%

            \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
          2. Taylor expanded in x around 0

            \[\leadsto \frac{\color{blue}{1}}{x} \]
          3. Step-by-step derivation
            1. Applied rewrites75.3%

              \[\leadsto \frac{\color{blue}{1}}{x} \]
          4. Recombined 3 regimes into one program.
          5. Add Preprocessing

          Alternative 4: 84.0% accurate, 4.6× speedup?

          \[\begin{array}{l} t_0 := \frac{1}{x + x \cdot y}\\ \mathbf{if}\;x \leq -2.05 \cdot 10^{+139}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -5:\\ \;\;\;\;\frac{\left(\left(0.5 \cdot y - 1\right) \cdot y - -1\right) \cdot x}{x \cdot x}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
          (FPCore (x y)
            :precision binary64
            (let* ((t_0 (/ 1.0 (+ x (* x y)))))
            (if (<= x -2.05e+139)
              t_0
              (if (<= x -5.0)
                (/ (* (- (* (- (* 0.5 y) 1.0) y) -1.0) x) (* x x))
                (if (<= x 1.1e-11) (/ 1.0 x) t_0)))))
          double code(double x, double y) {
          	double t_0 = 1.0 / (x + (x * y));
          	double tmp;
          	if (x <= -2.05e+139) {
          		tmp = t_0;
          	} else if (x <= -5.0) {
          		tmp = (((((0.5 * y) - 1.0) * y) - -1.0) * x) / (x * x);
          	} else if (x <= 1.1e-11) {
          		tmp = 1.0 / x;
          	} else {
          		tmp = t_0;
          	}
          	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)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8) :: t_0
              real(8) :: tmp
              t_0 = 1.0d0 / (x + (x * y))
              if (x <= (-2.05d+139)) then
                  tmp = t_0
              else if (x <= (-5.0d0)) then
                  tmp = (((((0.5d0 * y) - 1.0d0) * y) - (-1.0d0)) * x) / (x * x)
              else if (x <= 1.1d-11) then
                  tmp = 1.0d0 / x
              else
                  tmp = t_0
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double t_0 = 1.0 / (x + (x * y));
          	double tmp;
          	if (x <= -2.05e+139) {
          		tmp = t_0;
          	} else if (x <= -5.0) {
          		tmp = (((((0.5 * y) - 1.0) * y) - -1.0) * x) / (x * x);
          	} else if (x <= 1.1e-11) {
          		tmp = 1.0 / x;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	t_0 = 1.0 / (x + (x * y))
          	tmp = 0
          	if x <= -2.05e+139:
          		tmp = t_0
          	elif x <= -5.0:
          		tmp = (((((0.5 * y) - 1.0) * y) - -1.0) * x) / (x * x)
          	elif x <= 1.1e-11:
          		tmp = 1.0 / x
          	else:
          		tmp = t_0
          	return tmp
          
          function code(x, y)
          	t_0 = Float64(1.0 / Float64(x + Float64(x * y)))
          	tmp = 0.0
          	if (x <= -2.05e+139)
          		tmp = t_0;
          	elseif (x <= -5.0)
          		tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.5 * y) - 1.0) * y) - -1.0) * x) / Float64(x * x));
          	elseif (x <= 1.1e-11)
          		tmp = Float64(1.0 / x);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	t_0 = 1.0 / (x + (x * y));
          	tmp = 0.0;
          	if (x <= -2.05e+139)
          		tmp = t_0;
          	elseif (x <= -5.0)
          		tmp = (((((0.5 * y) - 1.0) * y) - -1.0) * x) / (x * x);
          	elseif (x <= 1.1e-11)
          		tmp = 1.0 / x;
          	else
          		tmp = t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e+139], t$95$0, If[LessEqual[x, -5.0], N[(N[(N[(N[(N[(N[(0.5 * y), $MachinePrecision] - 1.0), $MachinePrecision] * y), $MachinePrecision] - -1.0), $MachinePrecision] * x), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e-11], N[(1.0 / x), $MachinePrecision], t$95$0]]]]
          
          \begin{array}{l}
          t_0 := \frac{1}{x + x \cdot y}\\
          \mathbf{if}\;x \leq -2.05 \cdot 10^{+139}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;x \leq -5:\\
          \;\;\;\;\frac{\left(\left(0.5 \cdot y - 1\right) \cdot y - -1\right) \cdot x}{x \cdot x}\\
          
          \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\
          \;\;\;\;\frac{1}{x}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if x < -2.0500000000000001e139 or 1.1000000000000001e-11 < x

            1. Initial program 78.5%

              \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
            2. Taylor expanded in y around 0

              \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

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

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

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - \color{blue}{1}\right)}{x} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
              6. lower-*.f64N/A

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
              7. lower-/.f6460.2%

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}{x} \]
            4. Applied rewrites60.2%

              \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
            5. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x}} \]
              2. div-flipN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
              3. lower-unsound-/.f64N/A

                \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
              4. lower-unsound-/.f6460.2%

                \[\leadsto \frac{1}{\color{blue}{\frac{x}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}} \]
              5. lift-+.f64N/A

                \[\leadsto \frac{1}{\frac{x}{1 + \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
              6. +-commutativeN/A

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) + \color{blue}{1}}} \]
              7. add-flipN/A

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}} \]
              8. metadata-evalN/A

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - -1}} \]
              9. lower--.f6460.2%

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{-1}}} \]
            6. Applied rewrites60.2%

              \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\left(\frac{0.5}{x} - -0.5\right) \cdot y - 1\right) \cdot y - -1}}} \]
            7. Taylor expanded in y around 0

              \[\leadsto \frac{1}{\color{blue}{x + x \cdot y}} \]
            8. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{1}{x + \color{blue}{x \cdot y}} \]
              2. lower-*.f6465.3%

                \[\leadsto \frac{1}{x + x \cdot \color{blue}{y}} \]
            9. Applied rewrites65.3%

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

            if -2.0500000000000001e139 < x < -5

            1. Initial program 78.5%

              \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
            2. Taylor expanded in y around 0

              \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

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

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

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - \color{blue}{1}\right)}{x} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
              6. lower-*.f64N/A

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
              7. lower-/.f6460.2%

                \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}{x} \]
            4. Applied rewrites60.2%

              \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
            5. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x}} \]
              2. div-flipN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
              3. lower-unsound-/.f64N/A

                \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
              4. lower-unsound-/.f6460.2%

                \[\leadsto \frac{1}{\color{blue}{\frac{x}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}} \]
              5. lift-+.f64N/A

                \[\leadsto \frac{1}{\frac{x}{1 + \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
              6. +-commutativeN/A

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) + \color{blue}{1}}} \]
              7. add-flipN/A

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}} \]
              8. metadata-evalN/A

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - -1}} \]
              9. lower--.f6460.2%

                \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{-1}}} \]
            6. Applied rewrites60.2%

              \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\left(\frac{0.5}{x} - -0.5\right) \cdot y - 1\right) \cdot y - -1}}} \]
            7. Taylor expanded in x around inf

              \[\leadsto \frac{1}{\frac{x}{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}} \]
            8. Step-by-step derivation
              1. Applied rewrites64.4%

                \[\leadsto \frac{1}{\frac{x}{\left(0.5 \cdot y - 1\right) \cdot y - -1}} \]
              2. Step-by-step derivation
                1. *-lft-identityN/A

                  \[\leadsto \color{blue}{1 \cdot \frac{1}{\frac{x}{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}}} \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}} \cdot 1} \]
                3. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}}} \cdot 1 \]
                4. lift-/.f64N/A

                  \[\leadsto \frac{1}{\color{blue}{\frac{x}{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}}} \cdot 1 \]
                5. div-flip-revN/A

                  \[\leadsto \color{blue}{\frac{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}{x}} \cdot 1 \]
                6. rgt-mult-inverseN/A

                  \[\leadsto \frac{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}{x} \cdot \color{blue}{\left(x \cdot \frac{1}{x}\right)} \]
                7. mult-flip-revN/A

                  \[\leadsto \frac{\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1}{x} \cdot \color{blue}{\frac{x}{x}} \]
                8. frac-timesN/A

                  \[\leadsto \color{blue}{\frac{\left(\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1\right) \cdot x}{x \cdot x}} \]
                9. lift-*.f64N/A

                  \[\leadsto \frac{\left(\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1\right) \cdot x}{\color{blue}{x \cdot x}} \]
                10. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{\left(\left(\frac{1}{2} \cdot y - 1\right) \cdot y - -1\right) \cdot x}{x \cdot x}} \]
              3. Applied rewrites38.0%

                \[\leadsto \color{blue}{\frac{\left(\left(0.5 \cdot y - 1\right) \cdot y - -1\right) \cdot x}{x \cdot x}} \]

              if -5 < x < 1.1000000000000001e-11

              1. Initial program 78.5%

                \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
              2. Taylor expanded in x around 0

                \[\leadsto \frac{\color{blue}{1}}{x} \]
              3. Step-by-step derivation
                1. Applied rewrites75.3%

                  \[\leadsto \frac{\color{blue}{1}}{x} \]
              4. Recombined 3 regimes into one program.
              5. Add Preprocessing

              Alternative 5: 84.0% accurate, 5.8× speedup?

              \[\begin{array}{l} t_0 := \frac{1}{x + x \cdot y}\\ \mathbf{if}\;x \leq -3 \cdot 10^{+204}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -5:\\ \;\;\;\;\frac{1 + y \cdot \left(y \cdot 0.5 - 1\right)}{x}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
              (FPCore (x y)
                :precision binary64
                (let* ((t_0 (/ 1.0 (+ x (* x y)))))
                (if (<= x -3e+204)
                  t_0
                  (if (<= x -5.0)
                    (/ (+ 1.0 (* y (- (* y 0.5) 1.0))) x)
                    (if (<= x 1.1e-11) (/ 1.0 x) t_0)))))
              double code(double x, double y) {
              	double t_0 = 1.0 / (x + (x * y));
              	double tmp;
              	if (x <= -3e+204) {
              		tmp = t_0;
              	} else if (x <= -5.0) {
              		tmp = (1.0 + (y * ((y * 0.5) - 1.0))) / x;
              	} else if (x <= 1.1e-11) {
              		tmp = 1.0 / x;
              	} else {
              		tmp = t_0;
              	}
              	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)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = 1.0d0 / (x + (x * y))
                  if (x <= (-3d+204)) then
                      tmp = t_0
                  else if (x <= (-5.0d0)) then
                      tmp = (1.0d0 + (y * ((y * 0.5d0) - 1.0d0))) / x
                  else if (x <= 1.1d-11) then
                      tmp = 1.0d0 / x
                  else
                      tmp = t_0
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y) {
              	double t_0 = 1.0 / (x + (x * y));
              	double tmp;
              	if (x <= -3e+204) {
              		tmp = t_0;
              	} else if (x <= -5.0) {
              		tmp = (1.0 + (y * ((y * 0.5) - 1.0))) / x;
              	} else if (x <= 1.1e-11) {
              		tmp = 1.0 / x;
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(x, y):
              	t_0 = 1.0 / (x + (x * y))
              	tmp = 0
              	if x <= -3e+204:
              		tmp = t_0
              	elif x <= -5.0:
              		tmp = (1.0 + (y * ((y * 0.5) - 1.0))) / x
              	elif x <= 1.1e-11:
              		tmp = 1.0 / x
              	else:
              		tmp = t_0
              	return tmp
              
              function code(x, y)
              	t_0 = Float64(1.0 / Float64(x + Float64(x * y)))
              	tmp = 0.0
              	if (x <= -3e+204)
              		tmp = t_0;
              	elseif (x <= -5.0)
              		tmp = Float64(Float64(1.0 + Float64(y * Float64(Float64(y * 0.5) - 1.0))) / x);
              	elseif (x <= 1.1e-11)
              		tmp = Float64(1.0 / x);
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y)
              	t_0 = 1.0 / (x + (x * y));
              	tmp = 0.0;
              	if (x <= -3e+204)
              		tmp = t_0;
              	elseif (x <= -5.0)
              		tmp = (1.0 + (y * ((y * 0.5) - 1.0))) / x;
              	elseif (x <= 1.1e-11)
              		tmp = 1.0 / x;
              	else
              		tmp = t_0;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+204], t$95$0, If[LessEqual[x, -5.0], N[(N[(1.0 + N[(y * N[(N[(y * 0.5), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 1.1e-11], N[(1.0 / x), $MachinePrecision], t$95$0]]]]
              
              \begin{array}{l}
              t_0 := \frac{1}{x + x \cdot y}\\
              \mathbf{if}\;x \leq -3 \cdot 10^{+204}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq -5:\\
              \;\;\;\;\frac{1 + y \cdot \left(y \cdot 0.5 - 1\right)}{x}\\
              
              \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\
              \;\;\;\;\frac{1}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if x < -2.9999999999999998e204 or 1.1000000000000001e-11 < x

                1. Initial program 78.5%

                  \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
                2. Taylor expanded in y around 0

                  \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
                3. Step-by-step derivation
                  1. lower-+.f64N/A

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

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

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - \color{blue}{1}\right)}{x} \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                  5. lower-+.f64N/A

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                  6. lower-*.f64N/A

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                  7. lower-/.f6460.2%

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                4. Applied rewrites60.2%

                  \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
                5. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x}} \]
                  2. div-flipN/A

                    \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
                  3. lower-unsound-/.f64N/A

                    \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
                  4. lower-unsound-/.f6460.2%

                    \[\leadsto \frac{1}{\color{blue}{\frac{x}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}} \]
                  5. lift-+.f64N/A

                    \[\leadsto \frac{1}{\frac{x}{1 + \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
                  6. +-commutativeN/A

                    \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) + \color{blue}{1}}} \]
                  7. add-flipN/A

                    \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}} \]
                  8. metadata-evalN/A

                    \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - -1}} \]
                  9. lower--.f6460.2%

                    \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{-1}}} \]
                6. Applied rewrites60.2%

                  \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\left(\frac{0.5}{x} - -0.5\right) \cdot y - 1\right) \cdot y - -1}}} \]
                7. Taylor expanded in y around 0

                  \[\leadsto \frac{1}{\color{blue}{x + x \cdot y}} \]
                8. Step-by-step derivation
                  1. lower-+.f64N/A

                    \[\leadsto \frac{1}{x + \color{blue}{x \cdot y}} \]
                  2. lower-*.f6465.3%

                    \[\leadsto \frac{1}{x + x \cdot \color{blue}{y}} \]
                9. Applied rewrites65.3%

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

                if -2.9999999999999998e204 < x < -5

                1. Initial program 78.5%

                  \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
                2. Taylor expanded in y around 0

                  \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
                3. Step-by-step derivation
                  1. lower-+.f64N/A

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

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

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - \color{blue}{1}\right)}{x} \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                  5. lower-+.f64N/A

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                  6. lower-*.f64N/A

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                  7. lower-/.f6460.2%

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                4. Applied rewrites60.2%

                  \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
                5. Taylor expanded in x around inf

                  \[\leadsto \frac{1 + y \cdot \left(y \cdot \frac{1}{2} - 1\right)}{x} \]
                6. Step-by-step derivation
                  1. Applied rewrites64.4%

                    \[\leadsto \frac{1 + y \cdot \left(y \cdot 0.5 - 1\right)}{x} \]

                  if -5 < x < 1.1000000000000001e-11

                  1. Initial program 78.5%

                    \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
                  2. Taylor expanded in x around 0

                    \[\leadsto \frac{\color{blue}{1}}{x} \]
                  3. Step-by-step derivation
                    1. Applied rewrites75.3%

                      \[\leadsto \frac{\color{blue}{1}}{x} \]
                  4. Recombined 3 regimes into one program.
                  5. Add Preprocessing

                  Alternative 6: 81.6% accurate, 7.2× speedup?

                  \[\begin{array}{l} t_0 := \frac{1}{x + x \cdot y}\\ \mathbf{if}\;x \leq -450:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                  (FPCore (x y)
                    :precision binary64
                    (let* ((t_0 (/ 1.0 (+ x (* x y)))))
                    (if (<= x -450.0) t_0 (if (<= x 1.1e-11) (/ 1.0 x) t_0))))
                  double code(double x, double y) {
                  	double t_0 = 1.0 / (x + (x * y));
                  	double tmp;
                  	if (x <= -450.0) {
                  		tmp = t_0;
                  	} else if (x <= 1.1e-11) {
                  		tmp = 1.0 / x;
                  	} else {
                  		tmp = t_0;
                  	}
                  	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)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = 1.0d0 / (x + (x * y))
                      if (x <= (-450.0d0)) then
                          tmp = t_0
                      else if (x <= 1.1d-11) then
                          tmp = 1.0d0 / x
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y) {
                  	double t_0 = 1.0 / (x + (x * y));
                  	double tmp;
                  	if (x <= -450.0) {
                  		tmp = t_0;
                  	} else if (x <= 1.1e-11) {
                  		tmp = 1.0 / x;
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y):
                  	t_0 = 1.0 / (x + (x * y))
                  	tmp = 0
                  	if x <= -450.0:
                  		tmp = t_0
                  	elif x <= 1.1e-11:
                  		tmp = 1.0 / x
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(x, y)
                  	t_0 = Float64(1.0 / Float64(x + Float64(x * y)))
                  	tmp = 0.0
                  	if (x <= -450.0)
                  		tmp = t_0;
                  	elseif (x <= 1.1e-11)
                  		tmp = Float64(1.0 / x);
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y)
                  	t_0 = 1.0 / (x + (x * y));
                  	tmp = 0.0;
                  	if (x <= -450.0)
                  		tmp = t_0;
                  	elseif (x <= 1.1e-11)
                  		tmp = 1.0 / x;
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_] := Block[{t$95$0 = N[(1.0 / N[(x + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -450.0], t$95$0, If[LessEqual[x, 1.1e-11], N[(1.0 / x), $MachinePrecision], t$95$0]]]
                  
                  \begin{array}{l}
                  t_0 := \frac{1}{x + x \cdot y}\\
                  \mathbf{if}\;x \leq -450:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\
                  \;\;\;\;\frac{1}{x}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if x < -450 or 1.1000000000000001e-11 < x

                    1. Initial program 78.5%

                      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
                    2. Taylor expanded in y around 0

                      \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
                    3. Step-by-step derivation
                      1. lower-+.f64N/A

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

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

                        \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - \color{blue}{1}\right)}{x} \]
                      4. lower-*.f64N/A

                        \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                      5. lower-+.f64N/A

                        \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                      6. lower-*.f64N/A

                        \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                      7. lower-/.f6460.2%

                        \[\leadsto \frac{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}{x} \]
                    4. Applied rewrites60.2%

                      \[\leadsto \frac{\color{blue}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}{x} \]
                    5. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \color{blue}{\frac{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}{x}} \]
                      2. div-flipN/A

                        \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
                      3. lower-unsound-/.f64N/A

                        \[\leadsto \color{blue}{\frac{1}{\frac{x}{1 + y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
                      4. lower-unsound-/.f6460.2%

                        \[\leadsto \frac{1}{\color{blue}{\frac{x}{1 + y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right)}}} \]
                      5. lift-+.f64N/A

                        \[\leadsto \frac{1}{\frac{x}{1 + \color{blue}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right)}}} \]
                      6. +-commutativeN/A

                        \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) + \color{blue}{1}}} \]
                      7. add-flipN/A

                        \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}} \]
                      8. metadata-evalN/A

                        \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \frac{1}{x}\right) - 1\right) - -1}} \]
                      9. lower--.f6460.2%

                        \[\leadsto \frac{1}{\frac{x}{y \cdot \left(y \cdot \left(0.5 + 0.5 \cdot \frac{1}{x}\right) - 1\right) - \color{blue}{-1}}} \]
                    6. Applied rewrites60.2%

                      \[\leadsto \color{blue}{\frac{1}{\frac{x}{\left(\left(\frac{0.5}{x} - -0.5\right) \cdot y - 1\right) \cdot y - -1}}} \]
                    7. Taylor expanded in y around 0

                      \[\leadsto \frac{1}{\color{blue}{x + x \cdot y}} \]
                    8. Step-by-step derivation
                      1. lower-+.f64N/A

                        \[\leadsto \frac{1}{x + \color{blue}{x \cdot y}} \]
                      2. lower-*.f6465.3%

                        \[\leadsto \frac{1}{x + x \cdot \color{blue}{y}} \]
                    9. Applied rewrites65.3%

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

                    if -450 < x < 1.1000000000000001e-11

                    1. Initial program 78.5%

                      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
                    2. Taylor expanded in x around 0

                      \[\leadsto \frac{\color{blue}{1}}{x} \]
                    3. Step-by-step derivation
                      1. Applied rewrites75.3%

                        \[\leadsto \frac{\color{blue}{1}}{x} \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 7: 75.3% accurate, 19.3× speedup?

                    \[\frac{1}{x} \]
                    (FPCore (x y)
                      :precision binary64
                      (/ 1.0 x))
                    double code(double x, double y) {
                    	return 1.0 / x;
                    }
                    
                    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)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        code = 1.0d0 / x
                    end function
                    
                    public static double code(double x, double y) {
                    	return 1.0 / x;
                    }
                    
                    def code(x, y):
                    	return 1.0 / x
                    
                    function code(x, y)
                    	return Float64(1.0 / x)
                    end
                    
                    function tmp = code(x, y)
                    	tmp = 1.0 / x;
                    end
                    
                    code[x_, y_] := N[(1.0 / x), $MachinePrecision]
                    
                    \frac{1}{x}
                    
                    Derivation
                    1. Initial program 78.5%

                      \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x} \]
                    2. Taylor expanded in x around 0

                      \[\leadsto \frac{\color{blue}{1}}{x} \]
                    3. Step-by-step derivation
                      1. Applied rewrites75.3%

                        \[\leadsto \frac{\color{blue}{1}}{x} \]
                      2. Add Preprocessing

                      Reproduce

                      ?
                      herbie shell --seed 2025258 
                      (FPCore (x y)
                        :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
                        :precision binary64
                        (/ (exp (* x (log (/ x (+ x y))))) x))