Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A

Percentage Accurate: 68.9% → 99.8%
Time: 3.8s
Alternatives: 18
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
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 = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y)
	return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)))
end
function tmp = code(x, y)
	tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 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: 68.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
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 = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y)
	return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)))
end
function tmp = code(x, y)
	tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}

Alternative 1: 99.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (* (/ x (+ y x)) (/ y (+ (+ y x) 1.0))) (+ y x)))
double code(double x, double y) {
	return ((x / (y + x)) * (y / ((y + x) + 1.0))) / (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 = ((x / (y + x)) * (y / ((y + x) + 1.0d0))) / (y + x)
end function
public static double code(double x, double y) {
	return ((x / (y + x)) * (y / ((y + x) + 1.0))) / (y + x);
}
def code(x, y):
	return ((x / (y + x)) * (y / ((y + x) + 1.0))) / (y + x)
function code(x, y)
	return Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(y + x) + 1.0))) / Float64(y + x))
end
function tmp = code(x, y)
	tmp = ((x / (y + x)) * (y / ((y + x) + 1.0))) / (y + x);
end
code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}
\end{array}
Derivation
  1. Initial program 68.9%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
    9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    20. lower-+.f6487.9

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
  3. Applied rewrites87.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
    13. lift-+.f6499.8

      \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
  5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
    9. associate-*l/N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
    17. lift-+.f6499.8

      \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
  7. Applied rewrites99.8%

    \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
  8. Add Preprocessing

Alternative 2: 99.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{x}{y + x} \cdot \frac{\frac{y}{\left(y + x\right) + 1}}{y + x} \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (/ x (+ y x)) (/ (/ y (+ (+ y x) 1.0)) (+ y x))))
double code(double x, double y) {
	return (x / (y + x)) * ((y / ((y + x) + 1.0)) / (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 = (x / (y + x)) * ((y / ((y + x) + 1.0d0)) / (y + x))
end function
public static double code(double x, double y) {
	return (x / (y + x)) * ((y / ((y + x) + 1.0)) / (y + x));
}
def code(x, y):
	return (x / (y + x)) * ((y / ((y + x) + 1.0)) / (y + x))
function code(x, y)
	return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(Float64(y + x) + 1.0)) / Float64(y + x)))
end
function tmp = code(x, y)
	tmp = (x / (y + x)) * ((y / ((y + x) + 1.0)) / (y + x));
end
code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y + x} \cdot \frac{\frac{y}{\left(y + x\right) + 1}}{y + x}
\end{array}
Derivation
  1. Initial program 68.9%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
    9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    20. lower-+.f6487.9

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
  3. Applied rewrites87.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
    13. lift-+.f6499.8

      \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
  5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
    9. associate-*l/N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
    17. lift-+.f6499.8

      \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
  7. Applied rewrites99.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1}}{y + x} \]
    9. associate-/l*N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{y + x} \cdot \frac{\color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
    17. lift-+.f6499.8

      \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
  9. Applied rewrites99.8%

    \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{\left(y + x\right) + 1}}{y + x}} \]
  10. Add Preprocessing

Alternative 3: 94.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x} \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -1.4e+149)
   (/ (/ y x) (+ y x))
   (/ (* (/ x (+ y x)) y) (* (+ y x) (+ (+ y x) 1.0)))))
double code(double x, double y) {
	double tmp;
	if (x <= -1.4e+149) {
		tmp = (y / x) / (y + x);
	} else {
		tmp = ((x / (y + x)) * y) / ((y + x) * ((y + x) + 1.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) :: tmp
    if (x <= (-1.4d+149)) then
        tmp = (y / x) / (y + x)
    else
        tmp = ((x / (y + x)) * y) / ((y + x) * ((y + x) + 1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.4e+149) {
		tmp = (y / x) / (y + x);
	} else {
		tmp = ((x / (y + x)) * y) / ((y + x) * ((y + x) + 1.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -1.4e+149:
		tmp = (y / x) / (y + x)
	else:
		tmp = ((x / (y + x)) * y) / ((y + x) * ((y + x) + 1.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -1.4e+149)
		tmp = Float64(Float64(y / x) / Float64(y + x));
	else
		tmp = Float64(Float64(Float64(x / Float64(y + x)) * y) / Float64(Float64(y + x) * Float64(Float64(y + x) + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.4e+149)
		tmp = (y / x) / (y + x);
	else
		tmp = ((x / (y + x)) * y) / ((y + x) * ((y + x) + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -1.4e+149], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+149}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4e149

    1. Initial program 58.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      20. lower-+.f6482.3

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    3. Applied rewrites82.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
      13. lift-+.f6499.9

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
    5. Applied rewrites99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
      9. associate-*l/N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
      17. lift-+.f6499.9

        \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
    7. Applied rewrites99.9%

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

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]
    9. Step-by-step derivation
      1. lower-/.f6488.6

        \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
    10. Applied rewrites88.6%

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

    if -1.4e149 < x

    1. Initial program 70.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      20. lower-+.f6488.7

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    3. Applied rewrites88.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
      13. lift-+.f6499.7

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
    5. Applied rewrites99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot y}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + x\right) + 1\right)}} \]
      17. lift-+.f6495.9

        \[\leadsto \frac{\frac{x}{y + x} \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
    7. Applied rewrites95.9%

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

Alternative 4: 71.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-159}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -1.4e+149)
   (/ (/ y x) (+ y x))
   (if (<= x -5e-159)
     (* (/ x (* (+ y x) (+ y x))) (/ y (+ (+ y x) 1.0)))
     (/ (/ x (+ 1.0 y)) y))))
double code(double x, double y) {
	double tmp;
	if (x <= -1.4e+149) {
		tmp = (y / x) / (y + x);
	} else if (x <= -5e-159) {
		tmp = (x / ((y + x) * (y + x))) * (y / ((y + x) + 1.0));
	} else {
		tmp = (x / (1.0 + y)) / y;
	}
	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) :: tmp
    if (x <= (-1.4d+149)) then
        tmp = (y / x) / (y + x)
    else if (x <= (-5d-159)) then
        tmp = (x / ((y + x) * (y + x))) * (y / ((y + x) + 1.0d0))
    else
        tmp = (x / (1.0d0 + y)) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.4e+149) {
		tmp = (y / x) / (y + x);
	} else if (x <= -5e-159) {
		tmp = (x / ((y + x) * (y + x))) * (y / ((y + x) + 1.0));
	} else {
		tmp = (x / (1.0 + y)) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -1.4e+149:
		tmp = (y / x) / (y + x)
	elif x <= -5e-159:
		tmp = (x / ((y + x) * (y + x))) * (y / ((y + x) + 1.0))
	else:
		tmp = (x / (1.0 + y)) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -1.4e+149)
		tmp = Float64(Float64(y / x) / Float64(y + x));
	elseif (x <= -5e-159)
		tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(Float64(y + x) + 1.0)));
	else
		tmp = Float64(Float64(x / Float64(1.0 + y)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.4e+149)
		tmp = (y / x) / (y + x);
	elseif (x <= -5e-159)
		tmp = (x / ((y + x) * (y + x))) * (y / ((y + x) + 1.0));
	else
		tmp = (x / (1.0 + y)) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -1.4e+149], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-159], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+149}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\

\mathbf{elif}\;x \leq -5 \cdot 10^{-159}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.4e149

    1. Initial program 58.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      20. lower-+.f6482.3

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    3. Applied rewrites82.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
      13. lift-+.f6499.9

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
    5. Applied rewrites99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
      9. associate-*l/N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
      17. lift-+.f6499.9

        \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
    7. Applied rewrites99.9%

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

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]
    9. Step-by-step derivation
      1. lower-/.f6488.6

        \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
    10. Applied rewrites88.6%

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

    if -1.4e149 < x < -5.00000000000000032e-159

    1. Initial program 75.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      20. lower-+.f6497.1

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    3. Applied rewrites97.1%

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

    if -5.00000000000000032e-159 < x

    1. Initial program 68.2%

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

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

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

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

        \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
      4. lower-+.f6456.3

        \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
    4. Applied rewrites56.3%

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

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

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

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

        \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
      7. lift-+.f6457.3

        \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
    6. Applied rewrites57.3%

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

Alternative 5: 68.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y + x\right) + 1\\ \mathbf{if}\;x \leq -1.42 \cdot 10^{+56}:\\ \;\;\;\;\frac{1 \cdot \frac{y}{t\_0}}{y + x}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-159}:\\ \;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ (+ y x) 1.0)))
   (if (<= x -1.42e+56)
     (/ (* 1.0 (/ y t_0)) (+ y x))
     (if (<= x -5e-159)
       (* x (/ y (* t_0 (* (+ y x) (+ y x)))))
       (/ (/ x (+ 1.0 y)) y)))))
double code(double x, double y) {
	double t_0 = (y + x) + 1.0;
	double tmp;
	if (x <= -1.42e+56) {
		tmp = (1.0 * (y / t_0)) / (y + x);
	} else if (x <= -5e-159) {
		tmp = x * (y / (t_0 * ((y + x) * (y + x))));
	} else {
		tmp = (x / (1.0 + y)) / y;
	}
	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 = (y + x) + 1.0d0
    if (x <= (-1.42d+56)) then
        tmp = (1.0d0 * (y / t_0)) / (y + x)
    else if (x <= (-5d-159)) then
        tmp = x * (y / (t_0 * ((y + x) * (y + x))))
    else
        tmp = (x / (1.0d0 + y)) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y + x) + 1.0;
	double tmp;
	if (x <= -1.42e+56) {
		tmp = (1.0 * (y / t_0)) / (y + x);
	} else if (x <= -5e-159) {
		tmp = x * (y / (t_0 * ((y + x) * (y + x))));
	} else {
		tmp = (x / (1.0 + y)) / y;
	}
	return tmp;
}
def code(x, y):
	t_0 = (y + x) + 1.0
	tmp = 0
	if x <= -1.42e+56:
		tmp = (1.0 * (y / t_0)) / (y + x)
	elif x <= -5e-159:
		tmp = x * (y / (t_0 * ((y + x) * (y + x))))
	else:
		tmp = (x / (1.0 + y)) / y
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y + x) + 1.0)
	tmp = 0.0
	if (x <= -1.42e+56)
		tmp = Float64(Float64(1.0 * Float64(y / t_0)) / Float64(y + x));
	elseif (x <= -5e-159)
		tmp = Float64(x * Float64(y / Float64(t_0 * Float64(Float64(y + x) * Float64(y + x)))));
	else
		tmp = Float64(Float64(x / Float64(1.0 + y)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y + x) + 1.0;
	tmp = 0.0;
	if (x <= -1.42e+56)
		tmp = (1.0 * (y / t_0)) / (y + x);
	elseif (x <= -5e-159)
		tmp = x * (y / (t_0 * ((y + x) * (y + x))));
	else
		tmp = (x / (1.0 + y)) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[x, -1.42e+56], N[(N[(1.0 * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-159], N[(x * N[(y / N[(t$95$0 * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y + x\right) + 1\\
\mathbf{if}\;x \leq -1.42 \cdot 10^{+56}:\\
\;\;\;\;\frac{1 \cdot \frac{y}{t\_0}}{y + x}\\

\mathbf{elif}\;x \leq -5 \cdot 10^{-159}:\\
\;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.42e56

    1. Initial program 57.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      20. lower-+.f6486.1

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    3. Applied rewrites86.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
      13. lift-+.f6499.8

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
    5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
      9. associate-*l/N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
      17. lift-+.f6499.8

        \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
    7. Applied rewrites99.8%

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

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

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

      if -1.42e56 < x < -5.00000000000000032e-159

      1. Initial program 84.5%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
        9. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}\right)} \]
        21. lower-+.f6494.4

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}\right)} \]
      3. Applied rewrites94.4%

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

      if -5.00000000000000032e-159 < x

      1. Initial program 68.2%

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

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

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

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

          \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
        4. lower-+.f6456.3

          \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
      4. Applied rewrites56.3%

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

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

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

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

          \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
        6. lower-/.f64N/A

          \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
        7. lift-+.f6457.3

          \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
      6. Applied rewrites57.3%

        \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
    10. Recombined 3 regimes into one program.
    11. Add Preprocessing

    Alternative 6: 65.2% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-149}:\\ \;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\ \end{array} \end{array} \]
    (FPCore (x y)
     :precision binary64
     (if (<= x -3.5e-10)
       (/ (/ y (+ 1.0 x)) (+ y x))
       (if (<= x -1.3e-149)
         (/ (* x y) (* (* (+ x y) (+ x y)) (+ y 1.0)))
         (/ (/ x (+ 1.0 y)) y))))
    double code(double x, double y) {
    	double tmp;
    	if (x <= -3.5e-10) {
    		tmp = (y / (1.0 + x)) / (y + x);
    	} else if (x <= -1.3e-149) {
    		tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0));
    	} else {
    		tmp = (x / (1.0 + y)) / y;
    	}
    	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) :: tmp
        if (x <= (-3.5d-10)) then
            tmp = (y / (1.0d0 + x)) / (y + x)
        else if (x <= (-1.3d-149)) then
            tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0d0))
        else
            tmp = (x / (1.0d0 + y)) / y
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double tmp;
    	if (x <= -3.5e-10) {
    		tmp = (y / (1.0 + x)) / (y + x);
    	} else if (x <= -1.3e-149) {
    		tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0));
    	} else {
    		tmp = (x / (1.0 + y)) / y;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if x <= -3.5e-10:
    		tmp = (y / (1.0 + x)) / (y + x)
    	elif x <= -1.3e-149:
    		tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0))
    	else:
    		tmp = (x / (1.0 + y)) / y
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (x <= -3.5e-10)
    		tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x));
    	elseif (x <= -1.3e-149)
    		tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(y + 1.0)));
    	else
    		tmp = Float64(Float64(x / Float64(1.0 + y)) / y);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (x <= -3.5e-10)
    		tmp = (y / (1.0 + x)) / (y + x);
    	elseif (x <= -1.3e-149)
    		tmp = (x * y) / (((x + y) * (x + y)) * (y + 1.0));
    	else
    		tmp = (x / (1.0 + y)) / y;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[x, -3.5e-10], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.3e-149], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -3.5 \cdot 10^{-10}:\\
    \;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
    
    \mathbf{elif}\;x \leq -1.3 \cdot 10^{-149}:\\
    \;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(y + 1\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -3.4999999999999998e-10

      1. Initial program 63.1%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
        9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
        20. lower-+.f6488.5

          \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. Applied rewrites88.5%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
        13. lift-+.f6499.8

          \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
      5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
        9. associate-*l/N/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
        17. lift-+.f6499.8

          \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
      7. Applied rewrites99.8%

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

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

          \[\leadsto \frac{\frac{y}{\color{blue}{1 + x}}}{y + x} \]
        2. lower-+.f6475.2

          \[\leadsto \frac{\frac{y}{1 + \color{blue}{x}}}{y + x} \]
      10. Applied rewrites75.2%

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

      if -3.4999999999999998e-10 < x < -1.29999999999999999e-149

      1. Initial program 85.2%

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

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{y} + 1\right)} \]
      3. Step-by-step derivation
        1. Applied rewrites85.0%

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

        if -1.29999999999999999e-149 < x

        1. Initial program 68.2%

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

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

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

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
          4. lower-+.f6456.5

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
        4. Applied rewrites56.5%

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

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

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

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

            \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
          5. lower-/.f64N/A

            \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
          6. lower-/.f64N/A

            \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
          7. lift-+.f6457.4

            \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
        6. Applied rewrites57.4%

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

      Alternative 7: 62.2% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{elif}\;y \leq 58000000000000:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+164}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot y} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
      (FPCore (x y)
       :precision binary64
       (if (<= y -4.5e-10)
         (/ (/ y x) x)
         (if (<= y 1.75e-131)
           (/ y (* (+ 1.0 x) x))
           (if (<= y 58000000000000.0)
             (/ x (* (+ 1.0 y) y))
             (if (<= y 1.4e+164) (* (/ x (* (+ y x) y)) 1.0) (/ (/ x y) y))))))
      double code(double x, double y) {
      	double tmp;
      	if (y <= -4.5e-10) {
      		tmp = (y / x) / x;
      	} else if (y <= 1.75e-131) {
      		tmp = y / ((1.0 + x) * x);
      	} else if (y <= 58000000000000.0) {
      		tmp = x / ((1.0 + y) * y);
      	} else if (y <= 1.4e+164) {
      		tmp = (x / ((y + x) * y)) * 1.0;
      	} else {
      		tmp = (x / y) / y;
      	}
      	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) :: tmp
          if (y <= (-4.5d-10)) then
              tmp = (y / x) / x
          else if (y <= 1.75d-131) then
              tmp = y / ((1.0d0 + x) * x)
          else if (y <= 58000000000000.0d0) then
              tmp = x / ((1.0d0 + y) * y)
          else if (y <= 1.4d+164) then
              tmp = (x / ((y + x) * y)) * 1.0d0
          else
              tmp = (x / y) / y
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double tmp;
      	if (y <= -4.5e-10) {
      		tmp = (y / x) / x;
      	} else if (y <= 1.75e-131) {
      		tmp = y / ((1.0 + x) * x);
      	} else if (y <= 58000000000000.0) {
      		tmp = x / ((1.0 + y) * y);
      	} else if (y <= 1.4e+164) {
      		tmp = (x / ((y + x) * y)) * 1.0;
      	} else {
      		tmp = (x / y) / y;
      	}
      	return tmp;
      }
      
      def code(x, y):
      	tmp = 0
      	if y <= -4.5e-10:
      		tmp = (y / x) / x
      	elif y <= 1.75e-131:
      		tmp = y / ((1.0 + x) * x)
      	elif y <= 58000000000000.0:
      		tmp = x / ((1.0 + y) * y)
      	elif y <= 1.4e+164:
      		tmp = (x / ((y + x) * y)) * 1.0
      	else:
      		tmp = (x / y) / y
      	return tmp
      
      function code(x, y)
      	tmp = 0.0
      	if (y <= -4.5e-10)
      		tmp = Float64(Float64(y / x) / x);
      	elseif (y <= 1.75e-131)
      		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
      	elseif (y <= 58000000000000.0)
      		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
      	elseif (y <= 1.4e+164)
      		tmp = Float64(Float64(x / Float64(Float64(y + x) * y)) * 1.0);
      	else
      		tmp = Float64(Float64(x / y) / y);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	tmp = 0.0;
      	if (y <= -4.5e-10)
      		tmp = (y / x) / x;
      	elseif (y <= 1.75e-131)
      		tmp = y / ((1.0 + x) * x);
      	elseif (y <= 58000000000000.0)
      		tmp = x / ((1.0 + y) * y);
      	elseif (y <= 1.4e+164)
      		tmp = (x / ((y + x) * y)) * 1.0;
      	else
      		tmp = (x / y) / y;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := If[LessEqual[y, -4.5e-10], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.75e-131], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 58000000000000.0], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+164], N[(N[(x / N[(N[(y + x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\
      \;\;\;\;\frac{\frac{y}{x}}{x}\\
      
      \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\
      \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
      
      \mathbf{elif}\;y \leq 58000000000000:\\
      \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
      
      \mathbf{elif}\;y \leq 1.4 \cdot 10^{+164}:\\
      \;\;\;\;\frac{x}{\left(y + x\right) \cdot y} \cdot 1\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{x}{y}}{y}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 5 regimes
      2. if y < -4.5e-10

        1. Initial program 64.2%

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

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

            \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
          2. unpow2N/A

            \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
          3. lower-*.f6423.7

            \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
        4. Applied rewrites23.7%

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

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

            \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
          3. associate-/r*N/A

            \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
          5. lower-/.f6427.6

            \[\leadsto \frac{\frac{y}{x}}{x} \]
        6. Applied rewrites27.6%

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

        if -4.5e-10 < y < 1.7500000000000001e-131

        1. Initial program 70.5%

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

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

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

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

            \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
          4. lower-+.f6478.7

            \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
        4. Applied rewrites78.7%

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

        if 1.7500000000000001e-131 < y < 5.8e13

        1. Initial program 89.5%

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

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

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

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
          4. lower-+.f6441.7

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
        4. Applied rewrites41.7%

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

        if 5.8e13 < y < 1.4000000000000001e164

        1. Initial program 64.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

            \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
          9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
          20. lower-+.f6491.9

            \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
        3. Applied rewrites91.9%

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

          \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{1} \]
        5. Step-by-step derivation
          1. Applied rewrites81.3%

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

            \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{y}} \cdot 1 \]
          3. Step-by-step derivation
            1. Applied rewrites75.0%

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

            if 1.4000000000000001e164 < y

            1. Initial program 57.4%

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

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

                \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
              3. lower-*.f6483.0

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
            4. Applied rewrites83.0%

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

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

                \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
              3. associate-/r*N/A

                \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
              5. lower-/.f6487.6

                \[\leadsto \frac{\frac{x}{y}}{y} \]
            6. Applied rewrites87.6%

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

          Alternative 8: 61.5% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y -4.5e-10)
             (/ (/ y x) (+ y x))
             (if (<= y 1.75e-131) (/ y (* (+ 1.0 x) x)) (/ (/ x (+ 1.0 y)) (+ y x)))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / (y + x);
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = (x / (1.0 + y)) / (y + x);
          	}
          	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) :: tmp
              if (y <= (-4.5d-10)) then
                  tmp = (y / x) / (y + x)
              else if (y <= 1.75d-131) then
                  tmp = y / ((1.0d0 + x) * x)
              else
                  tmp = (x / (1.0d0 + y)) / (y + x)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / (y + x);
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = (x / (1.0 + y)) / (y + x);
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= -4.5e-10:
          		tmp = (y / x) / (y + x)
          	elif y <= 1.75e-131:
          		tmp = y / ((1.0 + x) * x)
          	else:
          		tmp = (x / (1.0 + y)) / (y + x)
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= -4.5e-10)
          		tmp = Float64(Float64(y / x) / Float64(y + x));
          	elseif (y <= 1.75e-131)
          		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
          	else
          		tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= -4.5e-10)
          		tmp = (y / x) / (y + x);
          	elseif (y <= 1.75e-131)
          		tmp = y / ((1.0 + x) * x);
          	else
          		tmp = (x / (1.0 + y)) / (y + x);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, -4.5e-10], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-131], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\
          \;\;\;\;\frac{\frac{y}{x}}{y + x}\\
          
          \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\
          \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -4.5e-10

            1. Initial program 64.2%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
              9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
              20. lower-+.f6488.5

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
            3. Applied rewrites88.5%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
              13. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
            5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
              9. associate-*l/N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
              17. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
            7. Applied rewrites99.8%

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

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

                \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
            10. Applied rewrites28.3%

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

            if -4.5e-10 < y < 1.7500000000000001e-131

            1. Initial program 70.5%

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

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

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

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
              4. lower-+.f6478.7

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
            4. Applied rewrites78.7%

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

            if 1.7500000000000001e-131 < y

            1. Initial program 70.4%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
              9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
              20. lower-+.f6491.5

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
            3. Applied rewrites91.5%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
              13. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
            5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
              9. associate-*l/N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
              17. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
            7. Applied rewrites99.8%

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

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

                \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
              2. lift-+.f6465.3

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

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

          Alternative 9: 61.4% accurate, 1.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y 1.75e-131) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ 1.0 y)) (+ y x))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= 1.75e-131) {
          		tmp = (y / (1.0 + x)) / (y + x);
          	} else {
          		tmp = (x / (1.0 + y)) / (y + x);
          	}
          	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) :: tmp
              if (y <= 1.75d-131) then
                  tmp = (y / (1.0d0 + x)) / (y + x)
              else
                  tmp = (x / (1.0d0 + y)) / (y + x)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= 1.75e-131) {
          		tmp = (y / (1.0 + x)) / (y + x);
          	} else {
          		tmp = (x / (1.0 + y)) / (y + x);
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= 1.75e-131:
          		tmp = (y / (1.0 + x)) / (y + x)
          	else:
          		tmp = (x / (1.0 + y)) / (y + x)
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= 1.75e-131)
          		tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x));
          	else
          		tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= 1.75e-131)
          		tmp = (y / (1.0 + x)) / (y + x);
          	else
          		tmp = (x / (1.0 + y)) / (y + x);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, 1.75e-131], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 1.75 \cdot 10^{-131}:\\
          \;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < 1.7500000000000001e-131

            1. Initial program 68.0%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
              9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
              20. lower-+.f6485.9

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
            3. Applied rewrites85.9%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
              13. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
            5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
              9. associate-*l/N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
              17. lift-+.f6499.9

                \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
            7. Applied rewrites99.9%

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

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

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

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

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

            if 1.7500000000000001e-131 < y

            1. Initial program 70.4%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
              9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
              20. lower-+.f6491.5

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
            3. Applied rewrites91.5%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
              13. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
            5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
              9. associate-*l/N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
              17. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
            7. Applied rewrites99.8%

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

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

                \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
              2. lift-+.f6465.3

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

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

          Alternative 10: 61.4% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+164}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y -4.5e-10)
             (/ (/ y x) x)
             (if (<= y 1.75e-131)
               (/ y (* (+ 1.0 x) x))
               (if (<= y 1.4e+164) (/ x (* (+ 1.0 y) y)) (/ (/ x y) y)))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / x;
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else if (y <= 1.4e+164) {
          		tmp = x / ((1.0 + y) * y);
          	} else {
          		tmp = (x / y) / y;
          	}
          	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) :: tmp
              if (y <= (-4.5d-10)) then
                  tmp = (y / x) / x
              else if (y <= 1.75d-131) then
                  tmp = y / ((1.0d0 + x) * x)
              else if (y <= 1.4d+164) then
                  tmp = x / ((1.0d0 + y) * y)
              else
                  tmp = (x / y) / y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / x;
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else if (y <= 1.4e+164) {
          		tmp = x / ((1.0 + y) * y);
          	} else {
          		tmp = (x / y) / y;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= -4.5e-10:
          		tmp = (y / x) / x
          	elif y <= 1.75e-131:
          		tmp = y / ((1.0 + x) * x)
          	elif y <= 1.4e+164:
          		tmp = x / ((1.0 + y) * y)
          	else:
          		tmp = (x / y) / y
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= -4.5e-10)
          		tmp = Float64(Float64(y / x) / x);
          	elseif (y <= 1.75e-131)
          		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
          	elseif (y <= 1.4e+164)
          		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
          	else
          		tmp = Float64(Float64(x / y) / y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= -4.5e-10)
          		tmp = (y / x) / x;
          	elseif (y <= 1.75e-131)
          		tmp = y / ((1.0 + x) * x);
          	elseif (y <= 1.4e+164)
          		tmp = x / ((1.0 + y) * y);
          	else
          		tmp = (x / y) / y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, -4.5e-10], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.75e-131], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+164], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\
          \;\;\;\;\frac{\frac{y}{x}}{x}\\
          
          \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\
          \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
          
          \mathbf{elif}\;y \leq 1.4 \cdot 10^{+164}:\\
          \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{y}}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if y < -4.5e-10

            1. Initial program 64.2%

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

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

                \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
              3. lower-*.f6423.7

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
            4. Applied rewrites23.7%

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

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

                \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
              3. associate-/r*N/A

                \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
              5. lower-/.f6427.6

                \[\leadsto \frac{\frac{y}{x}}{x} \]
            6. Applied rewrites27.6%

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

            if -4.5e-10 < y < 1.7500000000000001e-131

            1. Initial program 70.5%

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

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

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

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
              4. lower-+.f6478.7

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
            4. Applied rewrites78.7%

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

            if 1.7500000000000001e-131 < y < 1.4000000000000001e164

            1. Initial program 76.7%

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

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

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

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

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
              4. lower-+.f6453.1

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

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

            if 1.4000000000000001e164 < y

            1. Initial program 57.4%

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

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

                \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
              3. lower-*.f6483.0

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
            4. Applied rewrites83.0%

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

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

                \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
              3. associate-/r*N/A

                \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
              5. lower-/.f6487.6

                \[\leadsto \frac{\frac{x}{y}}{y} \]
            6. Applied rewrites87.6%

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

          Alternative 11: 61.2% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y -4.5e-10)
             (/ (/ y x) (+ y x))
             (if (<= y 1.75e-131) (/ y (* (+ 1.0 x) x)) (/ (/ x (+ 1.0 y)) y))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / (y + x);
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = (x / (1.0 + y)) / y;
          	}
          	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) :: tmp
              if (y <= (-4.5d-10)) then
                  tmp = (y / x) / (y + x)
              else if (y <= 1.75d-131) then
                  tmp = y / ((1.0d0 + x) * x)
              else
                  tmp = (x / (1.0d0 + y)) / y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / (y + x);
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = (x / (1.0 + y)) / y;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= -4.5e-10:
          		tmp = (y / x) / (y + x)
          	elif y <= 1.75e-131:
          		tmp = y / ((1.0 + x) * x)
          	else:
          		tmp = (x / (1.0 + y)) / y
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= -4.5e-10)
          		tmp = Float64(Float64(y / x) / Float64(y + x));
          	elseif (y <= 1.75e-131)
          		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
          	else
          		tmp = Float64(Float64(x / Float64(1.0 + y)) / y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= -4.5e-10)
          		tmp = (y / x) / (y + x);
          	elseif (y <= 1.75e-131)
          		tmp = y / ((1.0 + x) * x);
          	else
          		tmp = (x / (1.0 + y)) / y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, -4.5e-10], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-131], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\
          \;\;\;\;\frac{\frac{y}{x}}{y + x}\\
          
          \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\
          \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -4.5e-10

            1. Initial program 64.2%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
              9. times-fracN/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
              20. lower-+.f6488.5

                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
            3. Applied rewrites88.5%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
              13. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
            5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
              9. associate-*l/N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}}}{y + x} \]
              17. lift-+.f6499.8

                \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{\color{blue}{y + x}} \]
            7. Applied rewrites99.8%

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

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

                \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
            10. Applied rewrites28.3%

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

            if -4.5e-10 < y < 1.7500000000000001e-131

            1. Initial program 70.5%

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

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

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

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
              4. lower-+.f6478.7

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
            4. Applied rewrites78.7%

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

            if 1.7500000000000001e-131 < y

            1. Initial program 70.4%

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

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

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

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

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
              4. lower-+.f6462.9

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
            4. Applied rewrites62.9%

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

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

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

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

                \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
              6. lower-/.f64N/A

                \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
              7. lift-+.f6464.8

                \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
            6. Applied rewrites64.8%

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

          Alternative 12: 61.1% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y -4.5e-10)
             (/ (/ y x) x)
             (if (<= y 1.75e-131) (/ y (* (+ 1.0 x) x)) (/ (/ x (+ 1.0 y)) y))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / x;
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = (x / (1.0 + y)) / y;
          	}
          	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) :: tmp
              if (y <= (-4.5d-10)) then
                  tmp = (y / x) / x
              else if (y <= 1.75d-131) then
                  tmp = y / ((1.0d0 + x) * x)
              else
                  tmp = (x / (1.0d0 + y)) / y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= -4.5e-10) {
          		tmp = (y / x) / x;
          	} else if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = (x / (1.0 + y)) / y;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= -4.5e-10:
          		tmp = (y / x) / x
          	elif y <= 1.75e-131:
          		tmp = y / ((1.0 + x) * x)
          	else:
          		tmp = (x / (1.0 + y)) / y
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= -4.5e-10)
          		tmp = Float64(Float64(y / x) / x);
          	elseif (y <= 1.75e-131)
          		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
          	else
          		tmp = Float64(Float64(x / Float64(1.0 + y)) / y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= -4.5e-10)
          		tmp = (y / x) / x;
          	elseif (y <= 1.75e-131)
          		tmp = y / ((1.0 + x) * x);
          	else
          		tmp = (x / (1.0 + y)) / y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, -4.5e-10], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.75e-131], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -4.5 \cdot 10^{-10}:\\
          \;\;\;\;\frac{\frac{y}{x}}{x}\\
          
          \mathbf{elif}\;y \leq 1.75 \cdot 10^{-131}:\\
          \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{1 + y}}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -4.5e-10

            1. Initial program 64.2%

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

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

                \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
              3. lower-*.f6423.7

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
            4. Applied rewrites23.7%

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

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

                \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
              3. associate-/r*N/A

                \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
              5. lower-/.f6427.6

                \[\leadsto \frac{\frac{y}{x}}{x} \]
            6. Applied rewrites27.6%

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

            if -4.5e-10 < y < 1.7500000000000001e-131

            1. Initial program 70.5%

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

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

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

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
              4. lower-+.f6478.7

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
            4. Applied rewrites78.7%

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

            if 1.7500000000000001e-131 < y

            1. Initial program 70.4%

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

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

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

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

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
              4. lower-+.f6462.9

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
            4. Applied rewrites62.9%

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

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

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

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

                \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
              6. lower-/.f64N/A

                \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
              7. lift-+.f6464.8

                \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
            6. Applied rewrites64.8%

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

          Alternative 13: 60.9% accurate, 1.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+164}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y 1.75e-131)
             (/ y (* (+ 1.0 x) x))
             (if (<= y 1.4e+164) (/ x (* (+ 1.0 y) y)) (/ (/ x y) y))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else if (y <= 1.4e+164) {
          		tmp = x / ((1.0 + y) * y);
          	} else {
          		tmp = (x / y) / y;
          	}
          	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) :: tmp
              if (y <= 1.75d-131) then
                  tmp = y / ((1.0d0 + x) * x)
              else if (y <= 1.4d+164) then
                  tmp = x / ((1.0d0 + y) * y)
              else
                  tmp = (x / y) / y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else if (y <= 1.4e+164) {
          		tmp = x / ((1.0 + y) * y);
          	} else {
          		tmp = (x / y) / y;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= 1.75e-131:
          		tmp = y / ((1.0 + x) * x)
          	elif y <= 1.4e+164:
          		tmp = x / ((1.0 + y) * y)
          	else:
          		tmp = (x / y) / y
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= 1.75e-131)
          		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
          	elseif (y <= 1.4e+164)
          		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
          	else
          		tmp = Float64(Float64(x / y) / y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= 1.75e-131)
          		tmp = y / ((1.0 + x) * x);
          	elseif (y <= 1.4e+164)
          		tmp = x / ((1.0 + y) * y);
          	else
          		tmp = (x / y) / y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, 1.75e-131], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+164], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 1.75 \cdot 10^{-131}:\\
          \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
          
          \mathbf{elif}\;y \leq 1.4 \cdot 10^{+164}:\\
          \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{y}}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < 1.7500000000000001e-131

            1. Initial program 68.0%

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

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

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

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
              4. lower-+.f6457.5

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
            4. Applied rewrites57.5%

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

            if 1.7500000000000001e-131 < y < 1.4000000000000001e164

            1. Initial program 76.7%

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

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

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

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

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
              4. lower-+.f6453.1

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

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

            if 1.4000000000000001e164 < y

            1. Initial program 57.4%

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

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

                \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
              3. lower-*.f6483.0

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
            4. Applied rewrites83.0%

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

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

                \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
              3. associate-/r*N/A

                \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
              5. lower-/.f6487.6

                \[\leadsto \frac{\frac{x}{y}}{y} \]
            6. Applied rewrites87.6%

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

          Alternative 14: 60.0% accurate, 1.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.75 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= y 1.75e-131) (/ y (* (+ 1.0 x) x)) (/ x (* (+ 1.0 y) y))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = x / ((1.0 + y) * y);
          	}
          	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) :: tmp
              if (y <= 1.75d-131) then
                  tmp = y / ((1.0d0 + x) * x)
              else
                  tmp = x / ((1.0d0 + y) * y)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= 1.75e-131) {
          		tmp = y / ((1.0 + x) * x);
          	} else {
          		tmp = x / ((1.0 + y) * y);
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= 1.75e-131:
          		tmp = y / ((1.0 + x) * x)
          	else:
          		tmp = x / ((1.0 + y) * y)
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= 1.75e-131)
          		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
          	else
          		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= 1.75e-131)
          		tmp = y / ((1.0 + x) * x);
          	else
          		tmp = x / ((1.0 + y) * y);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, 1.75e-131], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 1.75 \cdot 10^{-131}:\\
          \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < 1.7500000000000001e-131

            1. Initial program 68.0%

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

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

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

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
              4. lower-+.f6457.5

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
            4. Applied rewrites57.5%

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

            if 1.7500000000000001e-131 < y

            1. Initial program 70.4%

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

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

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

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

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
              4. lower-+.f6462.9

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
            4. Applied rewrites62.9%

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

          Alternative 15: 59.4% accurate, 1.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6600000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (if (<= x -6600000000.0) (/ y (* x x)) (/ x (* (+ 1.0 y) y))))
          double code(double x, double y) {
          	double tmp;
          	if (x <= -6600000000.0) {
          		tmp = y / (x * x);
          	} else {
          		tmp = x / ((1.0 + y) * y);
          	}
          	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) :: tmp
              if (x <= (-6600000000.0d0)) then
                  tmp = y / (x * x)
              else
                  tmp = x / ((1.0d0 + y) * y)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (x <= -6600000000.0) {
          		tmp = y / (x * x);
          	} else {
          		tmp = x / ((1.0 + y) * y);
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if x <= -6600000000.0:
          		tmp = y / (x * x)
          	else:
          		tmp = x / ((1.0 + y) * y)
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (x <= -6600000000.0)
          		tmp = Float64(y / Float64(x * x));
          	else
          		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (x <= -6600000000.0)
          		tmp = y / (x * x);
          	else
          		tmp = x / ((1.0 + y) * y);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[x, -6600000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -6600000000:\\
          \;\;\;\;\frac{y}{x \cdot x}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -6.6e9

            1. Initial program 61.5%

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

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

                \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
              3. lower-*.f6472.7

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
            4. Applied rewrites72.7%

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

            if -6.6e9 < x

            1. Initial program 71.3%

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

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

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

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

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
              4. lower-+.f6457.8

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
            4. Applied rewrites57.8%

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

          Alternative 16: 54.4% accurate, 1.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y \cdot y}\\ \mathbf{if}\;x \leq -6800000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-186}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{-105}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y)
           :precision binary64
           (let* ((t_0 (/ x (* y y))))
             (if (<= x -6800000000.0)
               (/ y (* x x))
               (if (<= x -2.4e-186) t_0 (if (<= x 7.2e-105) (/ x y) t_0)))))
          double code(double x, double y) {
          	double t_0 = x / (y * y);
          	double tmp;
          	if (x <= -6800000000.0) {
          		tmp = y / (x * x);
          	} else if (x <= -2.4e-186) {
          		tmp = t_0;
          	} else if (x <= 7.2e-105) {
          		tmp = x / y;
          	} 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 = x / (y * y)
              if (x <= (-6800000000.0d0)) then
                  tmp = y / (x * x)
              else if (x <= (-2.4d-186)) then
                  tmp = t_0
              else if (x <= 7.2d-105) then
                  tmp = x / y
              else
                  tmp = t_0
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double t_0 = x / (y * y);
          	double tmp;
          	if (x <= -6800000000.0) {
          		tmp = y / (x * x);
          	} else if (x <= -2.4e-186) {
          		tmp = t_0;
          	} else if (x <= 7.2e-105) {
          		tmp = x / y;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y):
          	t_0 = x / (y * y)
          	tmp = 0
          	if x <= -6800000000.0:
          		tmp = y / (x * x)
          	elif x <= -2.4e-186:
          		tmp = t_0
          	elif x <= 7.2e-105:
          		tmp = x / y
          	else:
          		tmp = t_0
          	return tmp
          
          function code(x, y)
          	t_0 = Float64(x / Float64(y * y))
          	tmp = 0.0
          	if (x <= -6800000000.0)
          		tmp = Float64(y / Float64(x * x));
          	elseif (x <= -2.4e-186)
          		tmp = t_0;
          	elseif (x <= 7.2e-105)
          		tmp = Float64(x / y);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	t_0 = x / (y * y);
          	tmp = 0.0;
          	if (x <= -6800000000.0)
          		tmp = y / (x * x);
          	elseif (x <= -2.4e-186)
          		tmp = t_0;
          	elseif (x <= 7.2e-105)
          		tmp = x / y;
          	else
          		tmp = t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6800000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e-186], t$95$0, If[LessEqual[x, 7.2e-105], N[(x / y), $MachinePrecision], t$95$0]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{x}{y \cdot y}\\
          \mathbf{if}\;x \leq -6800000000:\\
          \;\;\;\;\frac{y}{x \cdot x}\\
          
          \mathbf{elif}\;x \leq -2.4 \cdot 10^{-186}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;x \leq 7.2 \cdot 10^{-105}:\\
          \;\;\;\;\frac{x}{y}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if x < -6.8e9

            1. Initial program 61.5%

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

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

                \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
              3. lower-*.f6472.7

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
            4. Applied rewrites72.7%

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

            if -6.8e9 < x < -2.40000000000000003e-186 or 7.19999999999999929e-105 < x

            1. Initial program 74.7%

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

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

                \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
              3. lower-*.f6436.4

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
            4. Applied rewrites36.4%

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

            if -2.40000000000000003e-186 < x < 7.19999999999999929e-105

            1. Initial program 64.9%

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

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

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

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

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
              4. lower-+.f6484.5

                \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
            4. Applied rewrites84.5%

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

              \[\leadsto \frac{x}{y} \]
            6. Step-by-step derivation
              1. Applied rewrites70.6%

                \[\leadsto \frac{x}{y} \]
            7. Recombined 3 regimes into one program.
            8. Add Preprocessing

            Alternative 17: 37.7% accurate, 1.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
            (FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ x (* y y))))
            double code(double x, double y) {
            	double tmp;
            	if (y <= 1.0) {
            		tmp = x / y;
            	} else {
            		tmp = x / (y * y);
            	}
            	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) :: tmp
                if (y <= 1.0d0) then
                    tmp = x / y
                else
                    tmp = x / (y * y)
                end if
                code = tmp
            end function
            
            public static double code(double x, double y) {
            	double tmp;
            	if (y <= 1.0) {
            		tmp = x / y;
            	} else {
            		tmp = x / (y * y);
            	}
            	return tmp;
            }
            
            def code(x, y):
            	tmp = 0
            	if y <= 1.0:
            		tmp = x / y
            	else:
            		tmp = x / (y * y)
            	return tmp
            
            function code(x, y)
            	tmp = 0.0
            	if (y <= 1.0)
            		tmp = Float64(x / y);
            	else
            		tmp = Float64(x / Float64(y * y));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y)
            	tmp = 0.0;
            	if (y <= 1.0)
            		tmp = x / y;
            	else
            		tmp = x / (y * y);
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq 1:\\
            \;\;\;\;\frac{x}{y}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{x}{y \cdot y}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < 1

              1. Initial program 71.1%

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

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

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

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

                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                4. lower-+.f6441.3

                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
              4. Applied rewrites41.3%

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

                \[\leadsto \frac{x}{y} \]
              6. Step-by-step derivation
                1. Applied rewrites26.4%

                  \[\leadsto \frac{x}{y} \]

                if 1 < y

                1. Initial program 62.1%

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

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

                    \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                  2. unpow2N/A

                    \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                  3. lower-*.f6471.6

                    \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                4. Applied rewrites71.6%

                  \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 18: 26.8% accurate, 3.3× speedup?

              \[\begin{array}{l} \\ \frac{x}{y} \end{array} \]
              (FPCore (x y) :precision binary64 (/ x y))
              double code(double x, double y) {
              	return x / y;
              }
              
              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 = x / y
              end function
              
              public static double code(double x, double y) {
              	return x / y;
              }
              
              def code(x, y):
              	return x / y
              
              function code(x, y)
              	return Float64(x / y)
              end
              
              function tmp = code(x, y)
              	tmp = x / y;
              end
              
              code[x_, y_] := N[(x / y), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \frac{x}{y}
              \end{array}
              
              Derivation
              1. Initial program 68.9%

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

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

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

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

                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                4. lower-+.f6449.1

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

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

                \[\leadsto \frac{x}{y} \]
              6. Step-by-step derivation
                1. Applied rewrites26.8%

                  \[\leadsto \frac{x}{y} \]
                2. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2025101 
                (FPCore (x y)
                  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
                  :precision binary64
                  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))