Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D

Percentage Accurate: 99.7% → 99.7%
Time: 10.4s
Alternatives: 12
Speedup: N/A×

Specification

?
\[\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}} \]
(FPCore (x y)
  :precision binary64
  (- (- 1 (/ 1 (* x 9))) (/ y (* 3 (sqrt x)))))
double code(double x, double y) {
	return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (1.0d0 - (1.0d0 / (x * 9.0d0))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
	return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y):
	return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * math.sqrt(x)))
function code(x, y)
	return Float64(Float64(1.0 - Float64(1.0 / Float64(x * 9.0))) - Float64(y / Float64(3.0 * sqrt(x))))
end
function tmp = code(x, y)
	tmp = (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
end
code[x_, y_] := N[(N[(1 - N[(1 / N[(x * 9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

\[\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}} \]
(FPCore (x y)
  :precision binary64
  (- (- 1 (/ 1 (* x 9))) (/ y (* 3 (sqrt x)))))
double code(double x, double y) {
	return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (1.0d0 - (1.0d0 / (x * 9.0d0))) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
	return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y):
	return (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * math.sqrt(x)))
function code(x, y)
	return Float64(Float64(1.0 - Float64(1.0 / Float64(x * 9.0))) - Float64(y / Float64(3.0 * sqrt(x))))
end
function tmp = code(x, y)
	tmp = (1.0 - (1.0 / (x * 9.0))) - (y / (3.0 * sqrt(x)));
end
code[x_, y_] := N[(N[(1 - N[(1 / N[(x * 9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}

Alternative 1: 99.7% accurate, 0.9× speedup?

\[\frac{9 - \frac{1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
(FPCore (x y)
  :precision binary64
  (- (/ (- 9 (/ 1 x)) 9) (/ y (* 3 (sqrt x)))))
double code(double x, double y) {
	return ((9.0 - (1.0 / x)) / 9.0) - (y / (3.0 * sqrt(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 = ((9.0d0 - (1.0d0 / x)) / 9.0d0) - (y / (3.0d0 * sqrt(x)))
end function
public static double code(double x, double y) {
	return ((9.0 - (1.0 / x)) / 9.0) - (y / (3.0 * Math.sqrt(x)));
}
def code(x, y):
	return ((9.0 - (1.0 / x)) / 9.0) - (y / (3.0 * math.sqrt(x)))
function code(x, y)
	return Float64(Float64(Float64(9.0 - Float64(1.0 / x)) / 9.0) - Float64(y / Float64(3.0 * sqrt(x))))
end
function tmp = code(x, y)
	tmp = ((9.0 - (1.0 / x)) / 9.0) - (y / (3.0 * sqrt(x)));
end
code[x_, y_] := N[(N[(N[(9 - N[(1 / x), $MachinePrecision]), $MachinePrecision] / 9), $MachinePrecision] - N[(y / N[(3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{9 - \frac{1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}}
Derivation
  1. Initial program 99.7%

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

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

      \[\leadsto \left(1 - \color{blue}{\frac{1}{x \cdot 9}}\right) - \frac{y}{3 \cdot \sqrt{x}} \]
    3. sub-to-fractionN/A

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1 \cdot \left(x \cdot 9\right) - 1}{x}}{9}} - \frac{y}{3 \cdot \sqrt{x}} \]
    7. *-lft-identityN/A

      \[\leadsto \frac{\frac{\color{blue}{x \cdot 9} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
    8. lift-*.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{x \cdot 9} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
    9. *-commutativeN/A

      \[\leadsto \frac{\frac{\color{blue}{9 \cdot x} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
    10. sub-to-fraction-revN/A

      \[\leadsto \frac{\color{blue}{9 - \frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
    11. lower--.f64N/A

      \[\leadsto \frac{\color{blue}{9 - \frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
    12. lower-/.f6499.7%

      \[\leadsto \frac{9 - \color{blue}{\frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
  3. Applied rewrites99.7%

    \[\leadsto \color{blue}{\frac{9 - \frac{1}{x}}{9}} - \frac{y}{3 \cdot \sqrt{x}} \]
  4. Add Preprocessing

Alternative 2: 99.6% accurate, 1.1× speedup?

\[\left(1 - \frac{\frac{1}{9}}{x}\right) + \frac{\frac{-1}{3}}{\sqrt{x}} \cdot y \]
(FPCore (x y)
  :precision binary64
  (+ (- 1 (/ 1/9 x)) (* (/ -1/3 (sqrt x)) y)))
double code(double x, double y) {
	return (1.0 - (0.1111111111111111 / x)) + ((-0.3333333333333333 / sqrt(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 = (1.0d0 - (0.1111111111111111d0 / x)) + (((-0.3333333333333333d0) / sqrt(x)) * y)
end function
public static double code(double x, double y) {
	return (1.0 - (0.1111111111111111 / x)) + ((-0.3333333333333333 / Math.sqrt(x)) * y);
}
def code(x, y):
	return (1.0 - (0.1111111111111111 / x)) + ((-0.3333333333333333 / math.sqrt(x)) * y)
function code(x, y)
	return Float64(Float64(1.0 - Float64(0.1111111111111111 / x)) + Float64(Float64(-0.3333333333333333 / sqrt(x)) * y))
end
function tmp = code(x, y)
	tmp = (1.0 - (0.1111111111111111 / x)) + ((-0.3333333333333333 / sqrt(x)) * y);
end
code[x_, y_] := N[(N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(-1/3 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\left(1 - \frac{\frac{1}{9}}{x}\right) + \frac{\frac{-1}{3}}{\sqrt{x}} \cdot y
Derivation
  1. Initial program 99.7%

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

      \[\leadsto \color{blue}{\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}} \]
    2. sub-flipN/A

      \[\leadsto \color{blue}{\left(1 - \frac{1}{x \cdot 9}\right) + \left(\mathsf{neg}\left(\frac{y}{3 \cdot \sqrt{x}}\right)\right)} \]
    3. add-flipN/A

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

      \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\frac{y}{3 \cdot \sqrt{x}}}\right)\right)\right)\right) \]
    5. distribute-neg-fracN/A

      \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \left(\mathsf{neg}\left(\color{blue}{\frac{\mathsf{neg}\left(y\right)}{3 \cdot \sqrt{x}}}\right)\right) \]
    6. distribute-frac-neg2N/A

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

      \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \color{blue}{\frac{y}{3 \cdot \sqrt{x}}} \]
    8. mult-flipN/A

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

      \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \color{blue}{\frac{1}{3 \cdot \sqrt{x}} \cdot y} \]
    10. fp-cancel-sub-sign-invN/A

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

      \[\leadsto \color{blue}{\left(1 - \frac{1}{x \cdot 9}\right) + \left(\mathsf{neg}\left(\frac{1}{3 \cdot \sqrt{x}}\right)\right) \cdot y} \]
  3. Applied rewrites99.6%

    \[\leadsto \color{blue}{\left(1 - \frac{\frac{1}{9}}{x}\right) + \frac{\frac{-1}{3}}{\sqrt{x}} \cdot y} \]
  4. Add Preprocessing

Alternative 3: 98.6% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \frac{y}{3 \cdot \sqrt{x}}\\ \mathbf{if}\;x \leq \frac{8116567392432203}{18446744073709551616}:\\ \;\;\;\;\frac{\frac{-1}{9}}{x} - t\_0\\ \mathbf{else}:\\ \;\;\;\;1 - t\_0\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (/ y (* 3 (sqrt x)))))
  (if (<= x 8116567392432203/18446744073709551616)
    (- (/ -1/9 x) t_0)
    (- 1 t_0))))
double code(double x, double y) {
	double t_0 = y / (3.0 * sqrt(x));
	double tmp;
	if (x <= 0.00044) {
		tmp = (-0.1111111111111111 / x) - t_0;
	} else {
		tmp = 1.0 - 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 = y / (3.0d0 * sqrt(x))
    if (x <= 0.00044d0) then
        tmp = ((-0.1111111111111111d0) / x) - t_0
    else
        tmp = 1.0d0 - t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y / (3.0 * Math.sqrt(x));
	double tmp;
	if (x <= 0.00044) {
		tmp = (-0.1111111111111111 / x) - t_0;
	} else {
		tmp = 1.0 - t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = y / (3.0 * math.sqrt(x))
	tmp = 0
	if x <= 0.00044:
		tmp = (-0.1111111111111111 / x) - t_0
	else:
		tmp = 1.0 - t_0
	return tmp
function code(x, y)
	t_0 = Float64(y / Float64(3.0 * sqrt(x)))
	tmp = 0.0
	if (x <= 0.00044)
		tmp = Float64(Float64(-0.1111111111111111 / x) - t_0);
	else
		tmp = Float64(1.0 - t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y / (3.0 * sqrt(x));
	tmp = 0.0;
	if (x <= 0.00044)
		tmp = (-0.1111111111111111 / x) - t_0;
	else
		tmp = 1.0 - t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 8116567392432203/18446744073709551616], N[(N[(-1/9 / x), $MachinePrecision] - t$95$0), $MachinePrecision], N[(1 - t$95$0), $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{y}{3 \cdot \sqrt{x}}\\
\mathbf{if}\;x \leq \frac{8116567392432203}{18446744073709551616}:\\
\;\;\;\;\frac{\frac{-1}{9}}{x} - t\_0\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 4.4000000000000002e-4

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{9}}{x}} - \frac{y}{3 \cdot \sqrt{x}} \]
    3. Step-by-step derivation
      1. lower-/.f6467.8%

        \[\leadsto \frac{\frac{-1}{9}}{\color{blue}{x}} - \frac{y}{3 \cdot \sqrt{x}} \]
    4. Applied rewrites67.8%

      \[\leadsto \color{blue}{\frac{\frac{-1}{9}}{x}} - \frac{y}{3 \cdot \sqrt{x}} \]

    if 4.4000000000000002e-4 < x

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{1} - \frac{y}{3 \cdot \sqrt{x}} \]
    3. Step-by-step derivation
      1. Applied rewrites69.0%

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

    Alternative 4: 93.1% accurate, 1.2× speedup?

    \[\begin{array}{l} \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\ \;\;\;\;1 - \frac{\frac{y}{\sqrt{x}}}{3}\\ \mathbf{elif}\;y \leq 5800000000000000000000:\\ \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\ \end{array} \]
    (FPCore (x y)
      :precision binary64
      (if (<=
         y
         -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872)
      (- 1 (/ (/ y (sqrt x)) 3))
      (if (<= y 5800000000000000000000)
        (- 1 (/ 1/9 x))
        (- 1 (/ y (* 3 (sqrt x)))))))
    double code(double x, double y) {
    	double tmp;
    	if (y <= -1.15e+110) {
    		tmp = 1.0 - ((y / sqrt(x)) / 3.0);
    	} else if (y <= 5.8e+21) {
    		tmp = 1.0 - (0.1111111111111111 / x);
    	} else {
    		tmp = 1.0 - (y / (3.0 * sqrt(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.15d+110)) then
            tmp = 1.0d0 - ((y / sqrt(x)) / 3.0d0)
        else if (y <= 5.8d+21) then
            tmp = 1.0d0 - (0.1111111111111111d0 / x)
        else
            tmp = 1.0d0 - (y / (3.0d0 * sqrt(x)))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double tmp;
    	if (y <= -1.15e+110) {
    		tmp = 1.0 - ((y / Math.sqrt(x)) / 3.0);
    	} else if (y <= 5.8e+21) {
    		tmp = 1.0 - (0.1111111111111111 / x);
    	} else {
    		tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
    	}
    	return tmp;
    }
    
    def code(x, y):
    	tmp = 0
    	if y <= -1.15e+110:
    		tmp = 1.0 - ((y / math.sqrt(x)) / 3.0)
    	elif y <= 5.8e+21:
    		tmp = 1.0 - (0.1111111111111111 / x)
    	else:
    		tmp = 1.0 - (y / (3.0 * math.sqrt(x)))
    	return tmp
    
    function code(x, y)
    	tmp = 0.0
    	if (y <= -1.15e+110)
    		tmp = Float64(1.0 - Float64(Float64(y / sqrt(x)) / 3.0));
    	elseif (y <= 5.8e+21)
    		tmp = Float64(1.0 - Float64(0.1111111111111111 / x));
    	else
    		tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	tmp = 0.0;
    	if (y <= -1.15e+110)
    		tmp = 1.0 - ((y / sqrt(x)) / 3.0);
    	elseif (y <= 5.8e+21)
    		tmp = 1.0 - (0.1111111111111111 / x);
    	else
    		tmp = 1.0 - (y / (3.0 * sqrt(x)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := If[LessEqual[y, -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872], N[(1 - N[(N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / 3), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5800000000000000000000], N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision], N[(1 - N[(y / N[(3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\
    \;\;\;\;1 - \frac{\frac{y}{\sqrt{x}}}{3}\\
    
    \mathbf{elif}\;y \leq 5800000000000000000000:\\
    \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -1.15e110

      1. Initial program 99.7%

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

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

          \[\leadsto \left(1 - \color{blue}{\frac{1}{x \cdot 9}}\right) - \frac{y}{3 \cdot \sqrt{x}} \]
        3. sub-to-fractionN/A

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{1 \cdot \left(x \cdot 9\right) - 1}{x}}{9}} - \frac{y}{3 \cdot \sqrt{x}} \]
        7. *-lft-identityN/A

          \[\leadsto \frac{\frac{\color{blue}{x \cdot 9} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\frac{\color{blue}{x \cdot 9} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\frac{\color{blue}{9 \cdot x} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
        10. sub-to-fraction-revN/A

          \[\leadsto \frac{\color{blue}{9 - \frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
        11. lower--.f64N/A

          \[\leadsto \frac{\color{blue}{9 - \frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
        12. lower-/.f6499.7%

          \[\leadsto \frac{9 - \color{blue}{\frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
      3. Applied rewrites99.7%

        \[\leadsto \color{blue}{\frac{9 - \frac{1}{x}}{9}} - \frac{y}{3 \cdot \sqrt{x}} \]
      4. Taylor expanded in x around inf

        \[\leadsto \color{blue}{1} - \frac{y}{3 \cdot \sqrt{x}} \]
      5. Step-by-step derivation
        1. Applied rewrites69.0%

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

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

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

            \[\leadsto 1 - \color{blue}{\frac{\frac{y}{3}}{\sqrt{x}}} \]
          4. mult-flipN/A

            \[\leadsto 1 - \color{blue}{\frac{y}{3} \cdot \frac{1}{\sqrt{x}}} \]
          5. metadata-evalN/A

            \[\leadsto 1 - \frac{y}{3} \cdot \frac{\color{blue}{\frac{9}{9}}}{\sqrt{x}} \]
          6. associate-/l/N/A

            \[\leadsto 1 - \frac{y}{3} \cdot \color{blue}{\frac{9}{9 \cdot \sqrt{x}}} \]
          7. frac-timesN/A

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

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

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

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

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

            \[\leadsto 1 - \frac{y \cdot 9}{\color{blue}{3 \cdot \left(9 \cdot \sqrt{x}\right)}} \]
          13. lower-*.f6468.9%

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

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

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

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

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

            \[\leadsto 1 - \color{blue}{\frac{y}{3} \cdot \frac{9}{9 \cdot \sqrt{x}}} \]
          5. lift-*.f64N/A

            \[\leadsto 1 - \frac{y}{3} \cdot \frac{9}{\color{blue}{9 \cdot \sqrt{x}}} \]
          6. associate-/l/N/A

            \[\leadsto 1 - \frac{y}{3} \cdot \color{blue}{\frac{\frac{9}{9}}{\sqrt{x}}} \]
          7. metadata-evalN/A

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

            \[\leadsto 1 - \color{blue}{\frac{y \cdot \frac{1}{\sqrt{x}}}{3}} \]
          9. mult-flipN/A

            \[\leadsto 1 - \frac{\color{blue}{\frac{y}{\sqrt{x}}}}{3} \]
          10. lift-/.f64N/A

            \[\leadsto 1 - \frac{\color{blue}{\frac{y}{\sqrt{x}}}}{3} \]
          11. lower-/.f6469.0%

            \[\leadsto 1 - \color{blue}{\frac{\frac{y}{\sqrt{x}}}{3}} \]
        5. Applied rewrites69.0%

          \[\leadsto 1 - \color{blue}{\frac{\frac{y}{\sqrt{x}}}{3}} \]

        if -1.15e110 < y < 5.8e21

        1. Initial program 99.7%

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

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

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

            \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
          3. lower-/.f64N/A

            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
          4. lower-+.f64N/A

            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
          5. lower-*.f64N/A

            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
          6. lower-/.f64N/A

            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
          7. lower-sqrt.f64N/A

            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
          8. lower-/.f6493.8%

            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
        4. Applied rewrites93.8%

          \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
        5. Taylor expanded in x around 0

          \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
        6. Step-by-step derivation
          1. Applied rewrites62.2%

            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
          2. Step-by-step derivation
            1. lift-*.f64N/A

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

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

              \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
            4. div-flipN/A

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

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

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

              \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
            8. lower-neg.f6462.2%

              \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
          3. Applied rewrites62.2%

            \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
          4. Applied rewrites62.2%

            \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]

          if 5.8e21 < y

          1. Initial program 99.7%

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

            \[\leadsto \color{blue}{1} - \frac{y}{3 \cdot \sqrt{x}} \]
          3. Step-by-step derivation
            1. Applied rewrites69.0%

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

          Alternative 5: 93.1% accurate, 1.2× speedup?

          \[\begin{array}{l} \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\ \;\;\;\;1 - \frac{\frac{1}{3} \cdot y}{\sqrt{x}}\\ \mathbf{elif}\;y \leq 5800000000000000000000:\\ \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\ \end{array} \]
          (FPCore (x y)
            :precision binary64
            (if (<=
               y
               -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872)
            (- 1 (/ (* 1/3 y) (sqrt x)))
            (if (<= y 5800000000000000000000)
              (- 1 (/ 1/9 x))
              (- 1 (/ y (* 3 (sqrt x)))))))
          double code(double x, double y) {
          	double tmp;
          	if (y <= -1.15e+110) {
          		tmp = 1.0 - ((0.3333333333333333 * y) / sqrt(x));
          	} else if (y <= 5.8e+21) {
          		tmp = 1.0 - (0.1111111111111111 / x);
          	} else {
          		tmp = 1.0 - (y / (3.0 * sqrt(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.15d+110)) then
                  tmp = 1.0d0 - ((0.3333333333333333d0 * y) / sqrt(x))
              else if (y <= 5.8d+21) then
                  tmp = 1.0d0 - (0.1111111111111111d0 / x)
              else
                  tmp = 1.0d0 - (y / (3.0d0 * sqrt(x)))
              end if
              code = tmp
          end function
          
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= -1.15e+110) {
          		tmp = 1.0 - ((0.3333333333333333 * y) / Math.sqrt(x));
          	} else if (y <= 5.8e+21) {
          		tmp = 1.0 - (0.1111111111111111 / x);
          	} else {
          		tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
          	}
          	return tmp;
          }
          
          def code(x, y):
          	tmp = 0
          	if y <= -1.15e+110:
          		tmp = 1.0 - ((0.3333333333333333 * y) / math.sqrt(x))
          	elif y <= 5.8e+21:
          		tmp = 1.0 - (0.1111111111111111 / x)
          	else:
          		tmp = 1.0 - (y / (3.0 * math.sqrt(x)))
          	return tmp
          
          function code(x, y)
          	tmp = 0.0
          	if (y <= -1.15e+110)
          		tmp = Float64(1.0 - Float64(Float64(0.3333333333333333 * y) / sqrt(x)));
          	elseif (y <= 5.8e+21)
          		tmp = Float64(1.0 - Float64(0.1111111111111111 / x));
          	else
          		tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= -1.15e+110)
          		tmp = 1.0 - ((0.3333333333333333 * y) / sqrt(x));
          	elseif (y <= 5.8e+21)
          		tmp = 1.0 - (0.1111111111111111 / x);
          	else
          		tmp = 1.0 - (y / (3.0 * sqrt(x)));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_] := If[LessEqual[y, -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872], N[(1 - N[(N[(1/3 * y), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5800000000000000000000], N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision], N[(1 - N[(y / N[(3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\
          \;\;\;\;1 - \frac{\frac{1}{3} \cdot y}{\sqrt{x}}\\
          
          \mathbf{elif}\;y \leq 5800000000000000000000:\\
          \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\
          
          \mathbf{else}:\\
          \;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -1.15e110

            1. Initial program 99.7%

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

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

                \[\leadsto \left(1 - \color{blue}{\frac{1}{x \cdot 9}}\right) - \frac{y}{3 \cdot \sqrt{x}} \]
              3. sub-to-fractionN/A

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

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

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

                \[\leadsto \color{blue}{\frac{\frac{1 \cdot \left(x \cdot 9\right) - 1}{x}}{9}} - \frac{y}{3 \cdot \sqrt{x}} \]
              7. *-lft-identityN/A

                \[\leadsto \frac{\frac{\color{blue}{x \cdot 9} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{\frac{\color{blue}{x \cdot 9} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
              9. *-commutativeN/A

                \[\leadsto \frac{\frac{\color{blue}{9 \cdot x} - 1}{x}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
              10. sub-to-fraction-revN/A

                \[\leadsto \frac{\color{blue}{9 - \frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
              11. lower--.f64N/A

                \[\leadsto \frac{\color{blue}{9 - \frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
              12. lower-/.f6499.7%

                \[\leadsto \frac{9 - \color{blue}{\frac{1}{x}}}{9} - \frac{y}{3 \cdot \sqrt{x}} \]
            3. Applied rewrites99.7%

              \[\leadsto \color{blue}{\frac{9 - \frac{1}{x}}{9}} - \frac{y}{3 \cdot \sqrt{x}} \]
            4. Taylor expanded in x around inf

              \[\leadsto \color{blue}{1} - \frac{y}{3 \cdot \sqrt{x}} \]
            5. Step-by-step derivation
              1. Applied rewrites69.0%

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

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

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

                  \[\leadsto 1 - \color{blue}{\frac{\frac{y}{3}}{\sqrt{x}}} \]
                4. mult-flipN/A

                  \[\leadsto 1 - \color{blue}{\frac{y}{3} \cdot \frac{1}{\sqrt{x}}} \]
                5. metadata-evalN/A

                  \[\leadsto 1 - \frac{y}{3} \cdot \frac{\color{blue}{\frac{9}{9}}}{\sqrt{x}} \]
                6. associate-/l/N/A

                  \[\leadsto 1 - \frac{y}{3} \cdot \color{blue}{\frac{9}{9 \cdot \sqrt{x}}} \]
                7. frac-timesN/A

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

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

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

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

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

                  \[\leadsto 1 - \frac{y \cdot 9}{\color{blue}{3 \cdot \left(9 \cdot \sqrt{x}\right)}} \]
                13. lower-*.f6468.9%

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

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

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

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

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

                  \[\leadsto 1 - \color{blue}{\frac{y}{3} \cdot \frac{9}{9 \cdot \sqrt{x}}} \]
                5. lift-*.f64N/A

                  \[\leadsto 1 - \frac{y}{3} \cdot \frac{9}{\color{blue}{9 \cdot \sqrt{x}}} \]
                6. associate-/l/N/A

                  \[\leadsto 1 - \frac{y}{3} \cdot \color{blue}{\frac{\frac{9}{9}}{\sqrt{x}}} \]
                7. metadata-evalN/A

                  \[\leadsto 1 - \frac{y}{3} \cdot \frac{\color{blue}{1}}{\sqrt{x}} \]
                8. mult-flipN/A

                  \[\leadsto 1 - \color{blue}{\frac{\frac{y}{3}}{\sqrt{x}}} \]
                9. lower-/.f64N/A

                  \[\leadsto 1 - \color{blue}{\frac{\frac{y}{3}}{\sqrt{x}}} \]
                10. mult-flipN/A

                  \[\leadsto 1 - \frac{\color{blue}{y \cdot \frac{1}{3}}}{\sqrt{x}} \]
                11. metadata-evalN/A

                  \[\leadsto 1 - \frac{y \cdot \color{blue}{\frac{1}{3}}}{\sqrt{x}} \]
                12. *-commutativeN/A

                  \[\leadsto 1 - \frac{\color{blue}{\frac{1}{3} \cdot y}}{\sqrt{x}} \]
                13. lower-*.f6468.9%

                  \[\leadsto 1 - \frac{\color{blue}{\frac{1}{3} \cdot y}}{\sqrt{x}} \]
              5. Applied rewrites68.9%

                \[\leadsto 1 - \color{blue}{\frac{\frac{1}{3} \cdot y}{\sqrt{x}}} \]

              if -1.15e110 < y < 5.8e21

              1. Initial program 99.7%

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

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

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

                  \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                3. lower-/.f64N/A

                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
                4. lower-+.f64N/A

                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                5. lower-*.f64N/A

                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                6. lower-/.f64N/A

                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                7. lower-sqrt.f64N/A

                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                8. lower-/.f6493.8%

                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
              4. Applied rewrites93.8%

                \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
              5. Taylor expanded in x around 0

                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
              6. Step-by-step derivation
                1. Applied rewrites62.2%

                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                2. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

                    \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
                  4. div-flipN/A

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

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

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

                    \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
                  8. lower-neg.f6462.2%

                    \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
                3. Applied rewrites62.2%

                  \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
                4. Applied rewrites62.2%

                  \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]

                if 5.8e21 < y

                1. Initial program 99.7%

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

                  \[\leadsto \color{blue}{1} - \frac{y}{3 \cdot \sqrt{x}} \]
                3. Step-by-step derivation
                  1. Applied rewrites69.0%

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

                Alternative 6: 93.1% accurate, 1.2× speedup?

                \[\begin{array}{l} \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\ \;\;\;\;\left(3 - \frac{y}{\sqrt{x}}\right) \cdot \frac{1}{3}\\ \mathbf{elif}\;y \leq 5800000000000000000000:\\ \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\ \mathbf{else}:\\ \;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\ \end{array} \]
                (FPCore (x y)
                  :precision binary64
                  (if (<=
                     y
                     -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872)
                  (* (- 3 (/ y (sqrt x))) 1/3)
                  (if (<= y 5800000000000000000000)
                    (- 1 (/ 1/9 x))
                    (- 1 (/ y (* 3 (sqrt x)))))))
                double code(double x, double y) {
                	double tmp;
                	if (y <= -1.15e+110) {
                		tmp = (3.0 - (y / sqrt(x))) * 0.3333333333333333;
                	} else if (y <= 5.8e+21) {
                		tmp = 1.0 - (0.1111111111111111 / x);
                	} else {
                		tmp = 1.0 - (y / (3.0 * sqrt(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.15d+110)) then
                        tmp = (3.0d0 - (y / sqrt(x))) * 0.3333333333333333d0
                    else if (y <= 5.8d+21) then
                        tmp = 1.0d0 - (0.1111111111111111d0 / x)
                    else
                        tmp = 1.0d0 - (y / (3.0d0 * sqrt(x)))
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y) {
                	double tmp;
                	if (y <= -1.15e+110) {
                		tmp = (3.0 - (y / Math.sqrt(x))) * 0.3333333333333333;
                	} else if (y <= 5.8e+21) {
                		tmp = 1.0 - (0.1111111111111111 / x);
                	} else {
                		tmp = 1.0 - (y / (3.0 * Math.sqrt(x)));
                	}
                	return tmp;
                }
                
                def code(x, y):
                	tmp = 0
                	if y <= -1.15e+110:
                		tmp = (3.0 - (y / math.sqrt(x))) * 0.3333333333333333
                	elif y <= 5.8e+21:
                		tmp = 1.0 - (0.1111111111111111 / x)
                	else:
                		tmp = 1.0 - (y / (3.0 * math.sqrt(x)))
                	return tmp
                
                function code(x, y)
                	tmp = 0.0
                	if (y <= -1.15e+110)
                		tmp = Float64(Float64(3.0 - Float64(y / sqrt(x))) * 0.3333333333333333);
                	elseif (y <= 5.8e+21)
                		tmp = Float64(1.0 - Float64(0.1111111111111111 / x));
                	else
                		tmp = Float64(1.0 - Float64(y / Float64(3.0 * sqrt(x))));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y)
                	tmp = 0.0;
                	if (y <= -1.15e+110)
                		tmp = (3.0 - (y / sqrt(x))) * 0.3333333333333333;
                	elseif (y <= 5.8e+21)
                		tmp = 1.0 - (0.1111111111111111 / x);
                	else
                		tmp = 1.0 - (y / (3.0 * sqrt(x)));
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_] := If[LessEqual[y, -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872], N[(N[(3 - N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1/3), $MachinePrecision], If[LessEqual[y, 5800000000000000000000], N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision], N[(1 - N[(y / N[(3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\
                \;\;\;\;\left(3 - \frac{y}{\sqrt{x}}\right) \cdot \frac{1}{3}\\
                
                \mathbf{elif}\;y \leq 5800000000000000000000:\\
                \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\
                
                \mathbf{else}:\\
                \;\;\;\;1 - \frac{y}{3 \cdot \sqrt{x}}\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if y < -1.15e110

                  1. Initial program 99.7%

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

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

                      \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \color{blue}{\frac{y}{3 \cdot \sqrt{x}}} \]
                    3. sub-to-fractionN/A

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

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

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

                      \[\leadsto \color{blue}{\frac{\frac{\left(1 - \frac{1}{x \cdot 9}\right) \cdot \left(3 \cdot \sqrt{x}\right) - y}{\sqrt{x}}}{3}} \]
                    7. mult-flipN/A

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

                      \[\leadsto \color{blue}{\frac{\left(1 - \frac{1}{x \cdot 9}\right) \cdot \left(3 \cdot \sqrt{x}\right) - y}{\sqrt{x}} \cdot \frac{1}{3}} \]
                  3. Applied rewrites99.4%

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

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

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

                    if -1.15e110 < y < 5.8e21

                    1. Initial program 99.7%

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

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

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

                        \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                      3. lower-/.f64N/A

                        \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
                      4. lower-+.f64N/A

                        \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                      5. lower-*.f64N/A

                        \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                      6. lower-/.f64N/A

                        \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                      7. lower-sqrt.f64N/A

                        \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                      8. lower-/.f6493.8%

                        \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                    4. Applied rewrites93.8%

                      \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                    5. Taylor expanded in x around 0

                      \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                    6. Step-by-step derivation
                      1. Applied rewrites62.2%

                        \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                      2. Step-by-step derivation
                        1. lift-*.f64N/A

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

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

                          \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
                        4. div-flipN/A

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

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

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

                          \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
                        8. lower-neg.f6462.2%

                          \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
                      3. Applied rewrites62.2%

                        \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
                      4. Applied rewrites62.2%

                        \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]

                      if 5.8e21 < y

                      1. Initial program 99.7%

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

                        \[\leadsto \color{blue}{1} - \frac{y}{3 \cdot \sqrt{x}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites69.0%

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

                      Alternative 7: 93.1% accurate, 1.2× speedup?

                      \[\begin{array}{l} t_0 := \left(3 - \frac{y}{\sqrt{x}}\right) \cdot \frac{1}{3}\\ \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 5800000000000000000000:\\ \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                      (FPCore (x y)
                        :precision binary64
                        (let* ((t_0 (* (- 3 (/ y (sqrt x))) 1/3)))
                        (if (<=
                             y
                             -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872)
                          t_0
                          (if (<= y 5800000000000000000000) (- 1 (/ 1/9 x)) t_0))))
                      double code(double x, double y) {
                      	double t_0 = (3.0 - (y / sqrt(x))) * 0.3333333333333333;
                      	double tmp;
                      	if (y <= -1.15e+110) {
                      		tmp = t_0;
                      	} else if (y <= 5.8e+21) {
                      		tmp = 1.0 - (0.1111111111111111 / x);
                      	} else {
                      		tmp = t_0;
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8) :: t_0
                          real(8) :: tmp
                          t_0 = (3.0d0 - (y / sqrt(x))) * 0.3333333333333333d0
                          if (y <= (-1.15d+110)) then
                              tmp = t_0
                          else if (y <= 5.8d+21) then
                              tmp = 1.0d0 - (0.1111111111111111d0 / x)
                          else
                              tmp = t_0
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y) {
                      	double t_0 = (3.0 - (y / Math.sqrt(x))) * 0.3333333333333333;
                      	double tmp;
                      	if (y <= -1.15e+110) {
                      		tmp = t_0;
                      	} else if (y <= 5.8e+21) {
                      		tmp = 1.0 - (0.1111111111111111 / x);
                      	} else {
                      		tmp = t_0;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y):
                      	t_0 = (3.0 - (y / math.sqrt(x))) * 0.3333333333333333
                      	tmp = 0
                      	if y <= -1.15e+110:
                      		tmp = t_0
                      	elif y <= 5.8e+21:
                      		tmp = 1.0 - (0.1111111111111111 / x)
                      	else:
                      		tmp = t_0
                      	return tmp
                      
                      function code(x, y)
                      	t_0 = Float64(Float64(3.0 - Float64(y / sqrt(x))) * 0.3333333333333333)
                      	tmp = 0.0
                      	if (y <= -1.15e+110)
                      		tmp = t_0;
                      	elseif (y <= 5.8e+21)
                      		tmp = Float64(1.0 - Float64(0.1111111111111111 / x));
                      	else
                      		tmp = t_0;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y)
                      	t_0 = (3.0 - (y / sqrt(x))) * 0.3333333333333333;
                      	tmp = 0.0;
                      	if (y <= -1.15e+110)
                      		tmp = t_0;
                      	elseif (y <= 5.8e+21)
                      		tmp = 1.0 - (0.1111111111111111 / x);
                      	else
                      		tmp = t_0;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_] := Block[{t$95$0 = N[(N[(3 - N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1/3), $MachinePrecision]}, If[LessEqual[y, -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872], t$95$0, If[LessEqual[y, 5800000000000000000000], N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                      
                      \begin{array}{l}
                      t_0 := \left(3 - \frac{y}{\sqrt{x}}\right) \cdot \frac{1}{3}\\
                      \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\
                      \;\;\;\;t\_0\\
                      
                      \mathbf{elif}\;y \leq 5800000000000000000000:\\
                      \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_0\\
                      
                      
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y < -1.15e110 or 5.8e21 < y

                        1. Initial program 99.7%

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

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

                            \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \color{blue}{\frac{y}{3 \cdot \sqrt{x}}} \]
                          3. sub-to-fractionN/A

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

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

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

                            \[\leadsto \color{blue}{\frac{\frac{\left(1 - \frac{1}{x \cdot 9}\right) \cdot \left(3 \cdot \sqrt{x}\right) - y}{\sqrt{x}}}{3}} \]
                          7. mult-flipN/A

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

                            \[\leadsto \color{blue}{\frac{\left(1 - \frac{1}{x \cdot 9}\right) \cdot \left(3 \cdot \sqrt{x}\right) - y}{\sqrt{x}} \cdot \frac{1}{3}} \]
                        3. Applied rewrites99.4%

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

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

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

                          if -1.15e110 < y < 5.8e21

                          1. Initial program 99.7%

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

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

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

                              \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                            3. lower-/.f64N/A

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
                            4. lower-+.f64N/A

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                            5. lower-*.f64N/A

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                            6. lower-/.f64N/A

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                            7. lower-sqrt.f64N/A

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                            8. lower-/.f6493.8%

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                          4. Applied rewrites93.8%

                            \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                          5. Taylor expanded in x around 0

                            \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                          6. Step-by-step derivation
                            1. Applied rewrites62.2%

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                            2. Step-by-step derivation
                              1. lift-*.f64N/A

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

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

                                \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
                              4. div-flipN/A

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

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

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

                                \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
                              8. lower-neg.f6462.2%

                                \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
                            3. Applied rewrites62.2%

                              \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
                            4. Applied rewrites62.2%

                              \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]
                          7. Recombined 2 regimes into one program.
                          8. Add Preprocessing

                          Alternative 8: 90.5% accurate, 1.3× speedup?

                          \[\begin{array}{l} \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\ \;\;\;\;\frac{\frac{-1}{3} \cdot y}{\sqrt{x}}\\ \mathbf{elif}\;y \leq 5800000000000000000000:\\ \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{-3 \cdot \sqrt{x}}\\ \end{array} \]
                          (FPCore (x y)
                            :precision binary64
                            (if (<=
                               y
                               -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872)
                            (/ (* -1/3 y) (sqrt x))
                            (if (<= y 5800000000000000000000)
                              (- 1 (/ 1/9 x))
                              (/ y (* -3 (sqrt x))))))
                          double code(double x, double y) {
                          	double tmp;
                          	if (y <= -1.15e+110) {
                          		tmp = (-0.3333333333333333 * y) / sqrt(x);
                          	} else if (y <= 5.8e+21) {
                          		tmp = 1.0 - (0.1111111111111111 / x);
                          	} else {
                          		tmp = y / (-3.0 * sqrt(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.15d+110)) then
                                  tmp = ((-0.3333333333333333d0) * y) / sqrt(x)
                              else if (y <= 5.8d+21) then
                                  tmp = 1.0d0 - (0.1111111111111111d0 / x)
                              else
                                  tmp = y / ((-3.0d0) * sqrt(x))
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y) {
                          	double tmp;
                          	if (y <= -1.15e+110) {
                          		tmp = (-0.3333333333333333 * y) / Math.sqrt(x);
                          	} else if (y <= 5.8e+21) {
                          		tmp = 1.0 - (0.1111111111111111 / x);
                          	} else {
                          		tmp = y / (-3.0 * Math.sqrt(x));
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y):
                          	tmp = 0
                          	if y <= -1.15e+110:
                          		tmp = (-0.3333333333333333 * y) / math.sqrt(x)
                          	elif y <= 5.8e+21:
                          		tmp = 1.0 - (0.1111111111111111 / x)
                          	else:
                          		tmp = y / (-3.0 * math.sqrt(x))
                          	return tmp
                          
                          function code(x, y)
                          	tmp = 0.0
                          	if (y <= -1.15e+110)
                          		tmp = Float64(Float64(-0.3333333333333333 * y) / sqrt(x));
                          	elseif (y <= 5.8e+21)
                          		tmp = Float64(1.0 - Float64(0.1111111111111111 / x));
                          	else
                          		tmp = Float64(y / Float64(-3.0 * sqrt(x)));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y)
                          	tmp = 0.0;
                          	if (y <= -1.15e+110)
                          		tmp = (-0.3333333333333333 * y) / sqrt(x);
                          	elseif (y <= 5.8e+21)
                          		tmp = 1.0 - (0.1111111111111111 / x);
                          	else
                          		tmp = y / (-3.0 * sqrt(x));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_] := If[LessEqual[y, -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872], N[(N[(-1/3 * y), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5800000000000000000000], N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision], N[(y / N[(-3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\
                          \;\;\;\;\frac{\frac{-1}{3} \cdot y}{\sqrt{x}}\\
                          
                          \mathbf{elif}\;y \leq 5800000000000000000000:\\
                          \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{y}{-3 \cdot \sqrt{x}}\\
                          
                          
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if y < -1.15e110

                            1. Initial program 99.7%

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

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

                                \[\leadsto \frac{-1}{3} \cdot \color{blue}{\frac{y}{\sqrt{x}}} \]
                              2. lower-/.f64N/A

                                \[\leadsto \frac{-1}{3} \cdot \frac{y}{\color{blue}{\sqrt{x}}} \]
                              3. lower-sqrt.f6438.5%

                                \[\leadsto \frac{-1}{3} \cdot \frac{y}{\sqrt{x}} \]
                            4. Applied rewrites38.5%

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

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

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

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

                                \[\leadsto \frac{\frac{-1}{3} \cdot y}{\color{blue}{\sqrt{x}}} \]
                              5. lower-*.f6438.5%

                                \[\leadsto \frac{\frac{-1}{3} \cdot y}{\sqrt{\color{blue}{x}}} \]
                            6. Applied rewrites38.5%

                              \[\leadsto \frac{\frac{-1}{3} \cdot y}{\color{blue}{\sqrt{x}}} \]

                            if -1.15e110 < y < 5.8e21

                            1. Initial program 99.7%

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

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

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

                                \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                              3. lower-/.f64N/A

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
                              4. lower-+.f64N/A

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                              5. lower-*.f64N/A

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                              6. lower-/.f64N/A

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                              7. lower-sqrt.f64N/A

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                              8. lower-/.f6493.8%

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                            4. Applied rewrites93.8%

                              \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                            5. Taylor expanded in x around 0

                              \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                            6. Step-by-step derivation
                              1. Applied rewrites62.2%

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                              2. Step-by-step derivation
                                1. lift-*.f64N/A

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

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

                                  \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
                                4. div-flipN/A

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

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

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

                                  \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
                                8. lower-neg.f6462.2%

                                  \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
                              3. Applied rewrites62.2%

                                \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
                              4. Applied rewrites62.2%

                                \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]

                              if 5.8e21 < y

                              1. Initial program 99.7%

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

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

                                  \[\leadsto \frac{-1}{3} \cdot \color{blue}{\frac{y}{\sqrt{x}}} \]
                                2. lower-/.f64N/A

                                  \[\leadsto \frac{-1}{3} \cdot \frac{y}{\color{blue}{\sqrt{x}}} \]
                                3. lower-sqrt.f6438.5%

                                  \[\leadsto \frac{-1}{3} \cdot \frac{y}{\sqrt{x}} \]
                              4. Applied rewrites38.5%

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

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

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

                                  \[\leadsto \frac{\frac{-1}{3} \cdot y}{\color{blue}{\sqrt{x}}} \]
                                4. mult-flipN/A

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

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

                                  \[\leadsto \frac{1}{\sqrt{x}} \cdot \color{blue}{\left(\frac{-1}{3} \cdot y\right)} \]
                                7. metadata-evalN/A

                                  \[\leadsto \frac{1}{\sqrt{x}} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot y\right) \]
                                8. distribute-lft-neg-outN/A

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

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

                                  \[\leadsto \frac{1}{\sqrt{x}} \cdot \left(\mathsf{neg}\left(y \cdot \frac{1}{3}\right)\right) \]
                                11. distribute-rgt-neg-inN/A

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

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

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

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

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

                                  \[\leadsto \mathsf{neg}\left(\frac{\left(y \cdot \frac{1}{3}\right) \cdot 1}{\sqrt{x}}\right) \]
                                17. mult-flipN/A

                                  \[\leadsto \mathsf{neg}\left(\left(\left(y \cdot \frac{1}{3}\right) \cdot 1\right) \cdot \frac{1}{\sqrt{x}}\right) \]
                                18. *-rgt-identityN/A

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

                                  \[\leadsto \mathsf{neg}\left(\left(y \cdot \frac{1}{3}\right) \cdot \frac{1}{\sqrt{x}}\right) \]
                                20. metadata-evalN/A

                                  \[\leadsto \mathsf{neg}\left(\left(y \cdot \frac{1}{3}\right) \cdot \frac{1}{\sqrt{x}}\right) \]
                                21. mult-flipN/A

                                  \[\leadsto \mathsf{neg}\left(\frac{y}{3} \cdot \frac{1}{\sqrt{x}}\right) \]
                                22. times-fracN/A

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

                                  \[\leadsto \mathsf{neg}\left(\frac{y \cdot 1}{3 \cdot \sqrt{x}}\right) \]
                                24. associate-*r/N/A

                                  \[\leadsto \mathsf{neg}\left(y \cdot \frac{1}{3 \cdot \sqrt{x}}\right) \]
                                25. mult-flipN/A

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

                                  \[\leadsto \mathsf{neg}\left(\frac{y}{3 \cdot \sqrt{x}}\right) \]
                              6. Applied rewrites38.6%

                                \[\leadsto \frac{y}{\color{blue}{-3 \cdot \sqrt{x}}} \]
                            7. Recombined 3 regimes into one program.
                            8. Add Preprocessing

                            Alternative 9: 90.5% accurate, 1.3× speedup?

                            \[\begin{array}{l} \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\ \;\;\;\;\frac{-1}{3} \cdot \frac{y}{\sqrt{x}}\\ \mathbf{elif}\;y \leq 5800000000000000000000:\\ \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{-3 \cdot \sqrt{x}}\\ \end{array} \]
                            (FPCore (x y)
                              :precision binary64
                              (if (<=
                                 y
                                 -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872)
                              (* -1/3 (/ y (sqrt x)))
                              (if (<= y 5800000000000000000000)
                                (- 1 (/ 1/9 x))
                                (/ y (* -3 (sqrt x))))))
                            double code(double x, double y) {
                            	double tmp;
                            	if (y <= -1.15e+110) {
                            		tmp = -0.3333333333333333 * (y / sqrt(x));
                            	} else if (y <= 5.8e+21) {
                            		tmp = 1.0 - (0.1111111111111111 / x);
                            	} else {
                            		tmp = y / (-3.0 * sqrt(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.15d+110)) then
                                    tmp = (-0.3333333333333333d0) * (y / sqrt(x))
                                else if (y <= 5.8d+21) then
                                    tmp = 1.0d0 - (0.1111111111111111d0 / x)
                                else
                                    tmp = y / ((-3.0d0) * sqrt(x))
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y) {
                            	double tmp;
                            	if (y <= -1.15e+110) {
                            		tmp = -0.3333333333333333 * (y / Math.sqrt(x));
                            	} else if (y <= 5.8e+21) {
                            		tmp = 1.0 - (0.1111111111111111 / x);
                            	} else {
                            		tmp = y / (-3.0 * Math.sqrt(x));
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y):
                            	tmp = 0
                            	if y <= -1.15e+110:
                            		tmp = -0.3333333333333333 * (y / math.sqrt(x))
                            	elif y <= 5.8e+21:
                            		tmp = 1.0 - (0.1111111111111111 / x)
                            	else:
                            		tmp = y / (-3.0 * math.sqrt(x))
                            	return tmp
                            
                            function code(x, y)
                            	tmp = 0.0
                            	if (y <= -1.15e+110)
                            		tmp = Float64(-0.3333333333333333 * Float64(y / sqrt(x)));
                            	elseif (y <= 5.8e+21)
                            		tmp = Float64(1.0 - Float64(0.1111111111111111 / x));
                            	else
                            		tmp = Float64(y / Float64(-3.0 * sqrt(x)));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y)
                            	tmp = 0.0;
                            	if (y <= -1.15e+110)
                            		tmp = -0.3333333333333333 * (y / sqrt(x));
                            	elseif (y <= 5.8e+21)
                            		tmp = 1.0 - (0.1111111111111111 / x);
                            	else
                            		tmp = y / (-3.0 * sqrt(x));
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_] := If[LessEqual[y, -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872], N[(-1/3 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5800000000000000000000], N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision], N[(y / N[(-3 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\
                            \;\;\;\;\frac{-1}{3} \cdot \frac{y}{\sqrt{x}}\\
                            
                            \mathbf{elif}\;y \leq 5800000000000000000000:\\
                            \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{y}{-3 \cdot \sqrt{x}}\\
                            
                            
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if y < -1.15e110

                              1. Initial program 99.7%

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

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

                                  \[\leadsto \frac{-1}{3} \cdot \color{blue}{\frac{y}{\sqrt{x}}} \]
                                2. lower-/.f64N/A

                                  \[\leadsto \frac{-1}{3} \cdot \frac{y}{\color{blue}{\sqrt{x}}} \]
                                3. lower-sqrt.f6438.5%

                                  \[\leadsto \frac{-1}{3} \cdot \frac{y}{\sqrt{x}} \]
                              4. Applied rewrites38.5%

                                \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{\sqrt{x}}} \]

                              if -1.15e110 < y < 5.8e21

                              1. Initial program 99.7%

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

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

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

                                  \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                                3. lower-/.f64N/A

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
                                4. lower-+.f64N/A

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                5. lower-*.f64N/A

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                6. lower-/.f64N/A

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                7. lower-sqrt.f64N/A

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                8. lower-/.f6493.8%

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                              4. Applied rewrites93.8%

                                \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                              5. Taylor expanded in x around 0

                                \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                              6. Step-by-step derivation
                                1. Applied rewrites62.2%

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                                2. Step-by-step derivation
                                  1. lift-*.f64N/A

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

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

                                    \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
                                  4. div-flipN/A

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

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

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

                                    \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
                                  8. lower-neg.f6462.2%

                                    \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
                                3. Applied rewrites62.2%

                                  \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
                                4. Applied rewrites62.2%

                                  \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]

                                if 5.8e21 < y

                                1. Initial program 99.7%

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

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

                                    \[\leadsto \frac{-1}{3} \cdot \color{blue}{\frac{y}{\sqrt{x}}} \]
                                  2. lower-/.f64N/A

                                    \[\leadsto \frac{-1}{3} \cdot \frac{y}{\color{blue}{\sqrt{x}}} \]
                                  3. lower-sqrt.f6438.5%

                                    \[\leadsto \frac{-1}{3} \cdot \frac{y}{\sqrt{x}} \]
                                4. Applied rewrites38.5%

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

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

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

                                    \[\leadsto \frac{\frac{-1}{3} \cdot y}{\color{blue}{\sqrt{x}}} \]
                                  4. mult-flipN/A

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

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

                                    \[\leadsto \frac{1}{\sqrt{x}} \cdot \color{blue}{\left(\frac{-1}{3} \cdot y\right)} \]
                                  7. metadata-evalN/A

                                    \[\leadsto \frac{1}{\sqrt{x}} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot y\right) \]
                                  8. distribute-lft-neg-outN/A

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

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

                                    \[\leadsto \frac{1}{\sqrt{x}} \cdot \left(\mathsf{neg}\left(y \cdot \frac{1}{3}\right)\right) \]
                                  11. distribute-rgt-neg-inN/A

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

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

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

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

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

                                    \[\leadsto \mathsf{neg}\left(\frac{\left(y \cdot \frac{1}{3}\right) \cdot 1}{\sqrt{x}}\right) \]
                                  17. mult-flipN/A

                                    \[\leadsto \mathsf{neg}\left(\left(\left(y \cdot \frac{1}{3}\right) \cdot 1\right) \cdot \frac{1}{\sqrt{x}}\right) \]
                                  18. *-rgt-identityN/A

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

                                    \[\leadsto \mathsf{neg}\left(\left(y \cdot \frac{1}{3}\right) \cdot \frac{1}{\sqrt{x}}\right) \]
                                  20. metadata-evalN/A

                                    \[\leadsto \mathsf{neg}\left(\left(y \cdot \frac{1}{3}\right) \cdot \frac{1}{\sqrt{x}}\right) \]
                                  21. mult-flipN/A

                                    \[\leadsto \mathsf{neg}\left(\frac{y}{3} \cdot \frac{1}{\sqrt{x}}\right) \]
                                  22. times-fracN/A

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

                                    \[\leadsto \mathsf{neg}\left(\frac{y \cdot 1}{3 \cdot \sqrt{x}}\right) \]
                                  24. associate-*r/N/A

                                    \[\leadsto \mathsf{neg}\left(y \cdot \frac{1}{3 \cdot \sqrt{x}}\right) \]
                                  25. mult-flipN/A

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

                                    \[\leadsto \mathsf{neg}\left(\frac{y}{3 \cdot \sqrt{x}}\right) \]
                                6. Applied rewrites38.6%

                                  \[\leadsto \frac{y}{\color{blue}{-3 \cdot \sqrt{x}}} \]
                              7. Recombined 3 regimes into one program.
                              8. Add Preprocessing

                              Alternative 10: 90.4% accurate, 1.3× speedup?

                              \[\begin{array}{l} t_0 := \frac{-1}{3} \cdot \frac{y}{\sqrt{x}}\\ \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 5800000000000000000000:\\ \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                              (FPCore (x y)
                                :precision binary64
                                (let* ((t_0 (* -1/3 (/ y (sqrt x)))))
                                (if (<=
                                     y
                                     -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872)
                                  t_0
                                  (if (<= y 5800000000000000000000) (- 1 (/ 1/9 x)) t_0))))
                              double code(double x, double y) {
                              	double t_0 = -0.3333333333333333 * (y / sqrt(x));
                              	double tmp;
                              	if (y <= -1.15e+110) {
                              		tmp = t_0;
                              	} else if (y <= 5.8e+21) {
                              		tmp = 1.0 - (0.1111111111111111 / x);
                              	} else {
                              		tmp = t_0;
                              	}
                              	return tmp;
                              }
                              
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(x, y)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8) :: t_0
                                  real(8) :: tmp
                                  t_0 = (-0.3333333333333333d0) * (y / sqrt(x))
                                  if (y <= (-1.15d+110)) then
                                      tmp = t_0
                                  else if (y <= 5.8d+21) then
                                      tmp = 1.0d0 - (0.1111111111111111d0 / x)
                                  else
                                      tmp = t_0
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double y) {
                              	double t_0 = -0.3333333333333333 * (y / Math.sqrt(x));
                              	double tmp;
                              	if (y <= -1.15e+110) {
                              		tmp = t_0;
                              	} else if (y <= 5.8e+21) {
                              		tmp = 1.0 - (0.1111111111111111 / x);
                              	} else {
                              		tmp = t_0;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y):
                              	t_0 = -0.3333333333333333 * (y / math.sqrt(x))
                              	tmp = 0
                              	if y <= -1.15e+110:
                              		tmp = t_0
                              	elif y <= 5.8e+21:
                              		tmp = 1.0 - (0.1111111111111111 / x)
                              	else:
                              		tmp = t_0
                              	return tmp
                              
                              function code(x, y)
                              	t_0 = Float64(-0.3333333333333333 * Float64(y / sqrt(x)))
                              	tmp = 0.0
                              	if (y <= -1.15e+110)
                              		tmp = t_0;
                              	elseif (y <= 5.8e+21)
                              		tmp = Float64(1.0 - Float64(0.1111111111111111 / x));
                              	else
                              		tmp = t_0;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y)
                              	t_0 = -0.3333333333333333 * (y / sqrt(x));
                              	tmp = 0.0;
                              	if (y <= -1.15e+110)
                              		tmp = t_0;
                              	elseif (y <= 5.8e+21)
                              		tmp = 1.0 - (0.1111111111111111 / x);
                              	else
                              		tmp = t_0;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_] := Block[{t$95$0 = N[(-1/3 * N[(y / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872], t$95$0, If[LessEqual[y, 5800000000000000000000], N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                              
                              \begin{array}{l}
                              t_0 := \frac{-1}{3} \cdot \frac{y}{\sqrt{x}}\\
                              \mathbf{if}\;y \leq -115000000000000001041737392316368418952585563486578824726577033924717415352482343137696415817006263974726991872:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;y \leq 5800000000000000000000:\\
                              \;\;\;\;1 - \frac{\frac{1}{9}}{x}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_0\\
                              
                              
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if y < -1.15e110 or 5.8e21 < y

                                1. Initial program 99.7%

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

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

                                    \[\leadsto \frac{-1}{3} \cdot \color{blue}{\frac{y}{\sqrt{x}}} \]
                                  2. lower-/.f64N/A

                                    \[\leadsto \frac{-1}{3} \cdot \frac{y}{\color{blue}{\sqrt{x}}} \]
                                  3. lower-sqrt.f6438.5%

                                    \[\leadsto \frac{-1}{3} \cdot \frac{y}{\sqrt{x}} \]
                                4. Applied rewrites38.5%

                                  \[\leadsto \color{blue}{\frac{-1}{3} \cdot \frac{y}{\sqrt{x}}} \]

                                if -1.15e110 < y < 5.8e21

                                1. Initial program 99.7%

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

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

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

                                    \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                                  3. lower-/.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
                                  4. lower-+.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  5. lower-*.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  6. lower-/.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  7. lower-sqrt.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  8. lower-/.f6493.8%

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                4. Applied rewrites93.8%

                                  \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                                5. Taylor expanded in x around 0

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites62.2%

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                                  2. Step-by-step derivation
                                    1. lift-*.f64N/A

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

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

                                      \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
                                    4. div-flipN/A

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

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

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

                                      \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
                                    8. lower-neg.f6462.2%

                                      \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
                                  3. Applied rewrites62.2%

                                    \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
                                  4. Applied rewrites62.2%

                                    \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]
                                7. Recombined 2 regimes into one program.
                                8. Add Preprocessing

                                Alternative 11: 62.2% accurate, 3.3× speedup?

                                \[1 - \frac{\frac{1}{9}}{x} \]
                                (FPCore (x y)
                                  :precision binary64
                                  (- 1 (/ 1/9 x)))
                                double code(double x, double y) {
                                	return 1.0 - (0.1111111111111111 / x);
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    code = 1.0d0 - (0.1111111111111111d0 / x)
                                end function
                                
                                public static double code(double x, double y) {
                                	return 1.0 - (0.1111111111111111 / x);
                                }
                                
                                def code(x, y):
                                	return 1.0 - (0.1111111111111111 / x)
                                
                                function code(x, y)
                                	return Float64(1.0 - Float64(0.1111111111111111 / x))
                                end
                                
                                function tmp = code(x, y)
                                	tmp = 1.0 - (0.1111111111111111 / x);
                                end
                                
                                code[x_, y_] := N[(1 - N[(1/9 / x), $MachinePrecision]), $MachinePrecision]
                                
                                1 - \frac{\frac{1}{9}}{x}
                                
                                Derivation
                                1. Initial program 99.7%

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

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

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

                                    \[\leadsto 1 + -1 \cdot \color{blue}{\frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                                  3. lower-/.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{\color{blue}{x}} \]
                                  4. lower-+.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  5. lower-*.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  6. lower-/.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  7. lower-sqrt.f64N/A

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                  8. lower-/.f6493.8%

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x} \]
                                4. Applied rewrites93.8%

                                  \[\leadsto \color{blue}{1 + -1 \cdot \frac{\frac{1}{9} + \frac{1}{3} \cdot \frac{y}{\sqrt{\frac{1}{x}}}}{x}} \]
                                5. Taylor expanded in x around 0

                                  \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites62.2%

                                    \[\leadsto 1 + -1 \cdot \frac{\frac{1}{9}}{x} \]
                                  2. Step-by-step derivation
                                    1. lift-*.f64N/A

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

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

                                      \[\leadsto 1 + \frac{-1 \cdot \frac{1}{9}}{\color{blue}{x}} \]
                                    4. div-flipN/A

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

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

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

                                      \[\leadsto 1 + \frac{1}{\frac{x}{\mathsf{neg}\left(\frac{1}{9}\right)}} \]
                                    8. lower-neg.f6462.2%

                                      \[\leadsto 1 + \frac{1}{\frac{x}{-\frac{1}{9}}} \]
                                  3. Applied rewrites62.2%

                                    \[\leadsto 1 + \frac{1}{\color{blue}{\frac{x}{-\frac{1}{9}}}} \]
                                  4. Applied rewrites62.2%

                                    \[\leadsto 1 - \color{blue}{\frac{\frac{1}{9}}{x}} \]
                                  5. Add Preprocessing

                                  Alternative 12: 31.1% accurate, 4.1× speedup?

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(1 + \frac{-1}{3} \cdot \frac{y}{\sqrt{x}}\right) - \frac{1}{9} \cdot \color{blue}{\frac{1}{x}} \]
                                    7. lower-/.f6499.5%

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

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

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

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

                                      \[\leadsto \left(1 + \frac{y}{\sqrt{x}} \cdot \frac{-1}{3}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    4. mult-flipN/A

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

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

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

                                      \[\leadsto \left(1 + y \cdot \left(\frac{1}{\sqrt{x}} \cdot \frac{-1}{3}\right)\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    8. metadata-evalN/A

                                      \[\leadsto \left(1 + y \cdot \left(\frac{1}{\sqrt{x}} \cdot \frac{1}{-3}\right)\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    9. metadata-evalN/A

                                      \[\leadsto \left(1 + y \cdot \left(\frac{1}{\sqrt{x}} \cdot \frac{1}{\mathsf{neg}\left(3\right)}\right)\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    10. times-fracN/A

                                      \[\leadsto \left(1 + y \cdot \frac{1 \cdot 1}{\sqrt{x} \cdot \left(\mathsf{neg}\left(3\right)\right)}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    11. metadata-evalN/A

                                      \[\leadsto \left(1 + y \cdot \frac{1}{\sqrt{x} \cdot \left(\mathsf{neg}\left(3\right)\right)}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    12. distribute-rgt-neg-inN/A

                                      \[\leadsto \left(1 + y \cdot \frac{1}{\mathsf{neg}\left(\sqrt{x} \cdot 3\right)}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    13. *-commutativeN/A

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

                                      \[\leadsto \left(1 + y \cdot \frac{1}{\mathsf{neg}\left(3 \cdot \sqrt{x}\right)}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    15. lower-*.f64N/A

                                      \[\leadsto \left(1 + y \cdot \frac{1}{\mathsf{neg}\left(3 \cdot \sqrt{x}\right)}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    16. metadata-evalN/A

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

                                      \[\leadsto \left(1 + y \cdot \frac{1 \cdot 1}{\mathsf{neg}\left(3 \cdot \sqrt{x}\right)}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    18. *-commutativeN/A

                                      \[\leadsto \left(1 + y \cdot \frac{1 \cdot 1}{\mathsf{neg}\left(\sqrt{x} \cdot 3\right)}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    19. distribute-lft-neg-inN/A

                                      \[\leadsto \left(1 + y \cdot \frac{1 \cdot 1}{\left(\mathsf{neg}\left(\sqrt{x}\right)\right) \cdot 3}\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    20. times-fracN/A

                                      \[\leadsto \left(1 + y \cdot \left(\frac{1}{\mathsf{neg}\left(\sqrt{x}\right)} \cdot \frac{1}{3}\right)\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    21. metadata-evalN/A

                                      \[\leadsto \left(1 + y \cdot \left(\frac{1}{\mathsf{neg}\left(\sqrt{x}\right)} \cdot \frac{1}{3}\right)\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                    22. lower-*.f64N/A

                                      \[\leadsto \left(1 + y \cdot \left(\frac{1}{\mathsf{neg}\left(\sqrt{x}\right)} \cdot \frac{1}{3}\right)\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                  6. Applied rewrites99.5%

                                    \[\leadsto \left(1 + y \cdot \left(\frac{-1}{\sqrt{x}} \cdot \frac{1}{3}\right)\right) - \frac{1}{9} \cdot \frac{1}{x} \]
                                  7. Taylor expanded in x around 0

                                    \[\leadsto \frac{\frac{-1}{9}}{\color{blue}{x}} \]
                                  8. Step-by-step derivation
                                    1. lower-/.f6431.1%

                                      \[\leadsto \frac{\frac{-1}{9}}{x} \]
                                  9. Applied rewrites31.1%

                                    \[\leadsto \frac{\frac{-1}{9}}{\color{blue}{x}} \]
                                  10. Add Preprocessing

                                  Reproduce

                                  ?
                                  herbie shell --seed 2025271 -o generate:evaluate
                                  (FPCore (x y)
                                    :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"
                                    :precision binary64
                                    (- (- 1 (/ 1 (* x 9))) (/ y (* 3 (sqrt x)))))