Rosa's DopplerBench

Percentage Accurate: 72.1% → 96.2%
Time: 7.0s
Alternatives: 12
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
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(u, v, t1)
use fmin_fmax_functions
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
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(u, v, t1)
use fmin_fmax_functions
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 96.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{\frac{t1}{u - t1} \cdot v}{\left(-u\right) + t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (/ t1 (- u t1)) v) (+ (- u) t1)))
double code(double u, double v, double t1) {
	return ((t1 / (u - t1)) * v) / (-u + t1);
}
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(u, v, t1)
use fmin_fmax_functions
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = ((t1 / (u - t1)) * v) / (-u + t1)
end function
public static double code(double u, double v, double t1) {
	return ((t1 / (u - t1)) * v) / (-u + t1);
}
def code(u, v, t1):
	return ((t1 / (u - t1)) * v) / (-u + t1)
function code(u, v, t1)
	return Float64(Float64(Float64(t1 / Float64(u - t1)) * v) / Float64(Float64(-u) + t1))
end
function tmp = code(u, v, t1)
	tmp = ((t1 / (u - t1)) * v) / (-u + t1);
end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(u - t1), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[((-u) + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{t1}{u - t1} \cdot v}{\left(-u\right) + t1}
\end{array}
Derivation
  1. Initial program 75.5%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Add Preprocessing
  3. Applied rewrites96.9%

    \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
  4. Final simplification96.9%

    \[\leadsto \frac{\frac{t1}{u - t1} \cdot v}{\left(-u\right) + t1} \]
  5. Add Preprocessing

Alternative 2: 87.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ t_2 := \frac{-v}{t1}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-308}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left(-t1\right) \cdot \frac{\frac{v}{u - t1}}{u}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+283}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))) (t_2 (/ (- v) t1)))
   (if (<= t_1 (- INFINITY))
     t_2
     (if (<= t_1 -2e-308)
       t_1
       (if (<= t_1 0.0)
         (* (- t1) (/ (/ v (- u t1)) u))
         (if (<= t_1 2e+283) t_1 t_2))))))
double code(double u, double v, double t1) {
	double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	double t_2 = -v / t1;
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_2;
	} else if (t_1 <= -2e-308) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = -t1 * ((v / (u - t1)) / u);
	} else if (t_1 <= 2e+283) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double u, double v, double t1) {
	double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	double t_2 = -v / t1;
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = t_2;
	} else if (t_1 <= -2e-308) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = -t1 * ((v / (u - t1)) / u);
	} else if (t_1 <= 2e+283) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u))
	t_2 = -v / t1
	tmp = 0
	if t_1 <= -math.inf:
		tmp = t_2
	elif t_1 <= -2e-308:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = -t1 * ((v / (u - t1)) / u)
	elif t_1 <= 2e+283:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
	t_2 = Float64(Float64(-v) / t1)
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_2;
	elseif (t_1 <= -2e-308)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(-t1) * Float64(Float64(v / Float64(u - t1)) / u));
	elseif (t_1 <= 2e+283)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
	t_2 = -v / t1;
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = t_2;
	elseif (t_1 <= -2e-308)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = -t1 * ((v / (u - t1)) / u);
	elseif (t_1 <= 2e+283)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-v) / t1), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, -2e-308], t$95$1, If[LessEqual[t$95$1, 0.0], N[((-t1) * N[(N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+283], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
t_2 := \frac{-v}{t1}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-308}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-t1\right) \cdot \frac{\frac{v}{u - t1}}{u}\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -inf.0 or 1.99999999999999991e283 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u)))

    1. Initial program 24.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in u around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    4. Step-by-step derivation
      1. Applied rewrites94.0%

        \[\leadsto \color{blue}{\frac{v}{-t1}} \]

      if -inf.0 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -1.9999999999999998e-308 or -0.0 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < 1.99999999999999991e283

      1. Initial program 98.9%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing

      if -1.9999999999999998e-308 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -0.0

      1. Initial program 76.7%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing
      3. Applied rewrites97.4%

        \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
      4. Taylor expanded in u around inf

        \[\leadsto \frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{\color{blue}{u}} \]
      5. Step-by-step derivation
        1. Applied rewrites71.6%

          \[\leadsto \frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{\color{blue}{u}} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{t1}{u - t1} \cdot \left(-v\right)}}{u} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{t1}{u - t1}} \cdot \left(-v\right)}{u} \]
          3. associate-*l/N/A

            \[\leadsto \frac{\color{blue}{\frac{t1 \cdot \left(-v\right)}{u - t1}}}{u} \]
          4. lift-neg.f64N/A

            \[\leadsto \frac{\frac{t1 \cdot \color{blue}{\left(\mathsf{neg}\left(v\right)\right)}}{u - t1}}{u} \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \frac{\frac{\color{blue}{\mathsf{neg}\left(t1 \cdot v\right)}}{u - t1}}{u} \]
          6. distribute-lft-neg-outN/A

            \[\leadsto \frac{\frac{\color{blue}{\left(\mathsf{neg}\left(t1\right)\right) \cdot v}}{u - t1}}{u} \]
          7. lift-neg.f64N/A

            \[\leadsto \frac{\frac{\color{blue}{\left(-t1\right)} \cdot v}{u - t1}}{u} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{\frac{\color{blue}{\left(-t1\right) \cdot v}}{u - t1}}{u} \]
          9. lower-/.f6470.6

            \[\leadsto \frac{\color{blue}{\frac{\left(-t1\right) \cdot v}{u - t1}}}{u} \]
        3. Applied rewrites70.6%

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

            \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{u - t1}}{u}} \]
          2. lift--.f64N/A

            \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{\color{blue}{u - t1}}}{u} \]
          3. lift-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\left(-t1\right) \cdot v}{u - t1}}}{u} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{\frac{\color{blue}{\left(-t1\right) \cdot v}}{u - t1}}{u} \]
          5. associate-/l*N/A

            \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot \frac{v}{u - t1}}}{u} \]
          6. associate-/l*N/A

            \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{\frac{v}{u - t1}}{u}} \]
          7. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{\frac{v}{u - t1}}{u}} \]
          8. lower-/.f64N/A

            \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{u - t1}}{u}} \]
          9. lower-/.f64N/A

            \[\leadsto \left(-t1\right) \cdot \frac{\color{blue}{\frac{v}{u - t1}}}{u} \]
          10. lift--.f6486.6

            \[\leadsto \left(-t1\right) \cdot \frac{\frac{v}{\color{blue}{u - t1}}}{u} \]
        5. Applied rewrites86.6%

          \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{\frac{v}{u - t1}}{u}} \]
      6. Recombined 3 regimes into one program.
      7. Final simplification92.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq -\infty:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq -2 \cdot 10^{-308}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq 0:\\ \;\;\;\;\left(-t1\right) \cdot \frac{\frac{v}{u - t1}}{u}\\ \mathbf{elif}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq 2 \cdot 10^{+283}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
      8. Add Preprocessing

      Alternative 3: 84.4% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+283}\right):\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (u v t1)
       :precision binary64
       (let* ((t_1 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))))
         (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+283))) (/ (- v) t1) t_1)))
      double code(double u, double v, double t1) {
      	double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
      	double tmp;
      	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+283)) {
      		tmp = -v / t1;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      public static double code(double u, double v, double t1) {
      	double t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
      	double tmp;
      	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+283)) {
      		tmp = -v / t1;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(u, v, t1):
      	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u))
      	tmp = 0
      	if (t_1 <= -math.inf) or not (t_1 <= 2e+283):
      		tmp = -v / t1
      	else:
      		tmp = t_1
      	return tmp
      
      function code(u, v, t1)
      	t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
      	tmp = 0.0
      	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+283))
      		tmp = Float64(Float64(-v) / t1);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(u, v, t1)
      	t_1 = (-t1 * v) / ((t1 + u) * (t1 + u));
      	tmp = 0.0;
      	if ((t_1 <= -Inf) || ~((t_1 <= 2e+283)))
      		tmp = -v / t1;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+283]], $MachinePrecision]], N[((-v) / t1), $MachinePrecision], t$95$1]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
      \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+283}\right):\\
      \;\;\;\;\frac{-v}{t1}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < -inf.0 or 1.99999999999999991e283 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u)))

        1. Initial program 24.2%

          \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in u around 0

          \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
        4. Step-by-step derivation
          1. Applied rewrites94.0%

            \[\leadsto \color{blue}{\frac{v}{-t1}} \]

          if -inf.0 < (/.f64 (*.f64 (neg.f64 t1) v) (*.f64 (+.f64 t1 u) (+.f64 t1 u))) < 1.99999999999999991e283

          1. Initial program 87.4%

            \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
          2. Add Preprocessing
        5. Recombined 2 regimes into one program.
        6. Final simplification88.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq -\infty \lor \neg \left(\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \leq 2 \cdot 10^{+283}\right):\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 4: 77.9% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -9.5 \cdot 10^{-75} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \end{array} \end{array} \]
        (FPCore (u v t1)
         :precision binary64
         (if (or (<= t1 -9.5e-75) (not (<= t1 8.2e-119)))
           (/ v (- u t1))
           (/ (* t1 (/ (- v) u)) u)))
        double code(double u, double v, double t1) {
        	double tmp;
        	if ((t1 <= -9.5e-75) || !(t1 <= 8.2e-119)) {
        		tmp = v / (u - t1);
        	} else {
        		tmp = (t1 * (-v / u)) / u;
        	}
        	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(u, v, t1)
        use fmin_fmax_functions
            real(8), intent (in) :: u
            real(8), intent (in) :: v
            real(8), intent (in) :: t1
            real(8) :: tmp
            if ((t1 <= (-9.5d-75)) .or. (.not. (t1 <= 8.2d-119))) then
                tmp = v / (u - t1)
            else
                tmp = (t1 * (-v / u)) / u
            end if
            code = tmp
        end function
        
        public static double code(double u, double v, double t1) {
        	double tmp;
        	if ((t1 <= -9.5e-75) || !(t1 <= 8.2e-119)) {
        		tmp = v / (u - t1);
        	} else {
        		tmp = (t1 * (-v / u)) / u;
        	}
        	return tmp;
        }
        
        def code(u, v, t1):
        	tmp = 0
        	if (t1 <= -9.5e-75) or not (t1 <= 8.2e-119):
        		tmp = v / (u - t1)
        	else:
        		tmp = (t1 * (-v / u)) / u
        	return tmp
        
        function code(u, v, t1)
        	tmp = 0.0
        	if ((t1 <= -9.5e-75) || !(t1 <= 8.2e-119))
        		tmp = Float64(v / Float64(u - t1));
        	else
        		tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u);
        	end
        	return tmp
        end
        
        function tmp_2 = code(u, v, t1)
        	tmp = 0.0;
        	if ((t1 <= -9.5e-75) || ~((t1 <= 8.2e-119)))
        		tmp = v / (u - t1);
        	else
        		tmp = (t1 * (-v / u)) / u;
        	end
        	tmp_2 = tmp;
        end
        
        code[u_, v_, t1_] := If[Or[LessEqual[t1, -9.5e-75], N[Not[LessEqual[t1, 8.2e-119]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;t1 \leq -9.5 \cdot 10^{-75} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\
        \;\;\;\;\frac{v}{u - t1}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t1 < -9.4999999999999991e-75 or 8.20000000000000041e-119 < t1

          1. Initial program 71.5%

            \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
          2. Add Preprocessing
          3. Applied rewrites98.6%

            \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
          4. Taylor expanded in u around 0

            \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
          5. Step-by-step derivation
            1. Applied rewrites82.8%

              \[\leadsto \frac{\color{blue}{v}}{u - t1} \]

            if -9.4999999999999991e-75 < t1 < 8.20000000000000041e-119

            1. Initial program 84.0%

              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
            2. Add Preprocessing
            3. Applied rewrites93.1%

              \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
            4. Taylor expanded in u around 0

              \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
            5. Step-by-step derivation
              1. Applied rewrites30.2%

                \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
              2. Taylor expanded in u around inf

                \[\leadsto \frac{v}{\color{blue}{u}} \]
              3. Step-by-step derivation
                1. Applied rewrites14.8%

                  \[\leadsto \frac{v}{\color{blue}{u}} \]
                2. Taylor expanded in u around inf

                  \[\leadsto \frac{\color{blue}{-1 \cdot \frac{t1 \cdot v}{u}}}{u} \]
                3. Step-by-step derivation
                  1. Applied rewrites85.8%

                    \[\leadsto \frac{\color{blue}{t1 \cdot \frac{-v}{u}}}{u} \]
                4. Recombined 2 regimes into one program.
                5. Final simplification83.8%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -9.5 \cdot 10^{-75} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \end{array} \]
                6. Add Preprocessing

                Alternative 5: 78.0% accurate, 0.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -9.5 \cdot 10^{-75} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \end{array} \end{array} \]
                (FPCore (u v t1)
                 :precision binary64
                 (if (or (<= t1 -9.5e-75) (not (<= t1 8.2e-119)))
                   (/ v (- u t1))
                   (* (/ t1 u) (/ (- v) u))))
                double code(double u, double v, double t1) {
                	double tmp;
                	if ((t1 <= -9.5e-75) || !(t1 <= 8.2e-119)) {
                		tmp = v / (u - t1);
                	} else {
                		tmp = (t1 / u) * (-v / u);
                	}
                	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(u, v, t1)
                use fmin_fmax_functions
                    real(8), intent (in) :: u
                    real(8), intent (in) :: v
                    real(8), intent (in) :: t1
                    real(8) :: tmp
                    if ((t1 <= (-9.5d-75)) .or. (.not. (t1 <= 8.2d-119))) then
                        tmp = v / (u - t1)
                    else
                        tmp = (t1 / u) * (-v / u)
                    end if
                    code = tmp
                end function
                
                public static double code(double u, double v, double t1) {
                	double tmp;
                	if ((t1 <= -9.5e-75) || !(t1 <= 8.2e-119)) {
                		tmp = v / (u - t1);
                	} else {
                		tmp = (t1 / u) * (-v / u);
                	}
                	return tmp;
                }
                
                def code(u, v, t1):
                	tmp = 0
                	if (t1 <= -9.5e-75) or not (t1 <= 8.2e-119):
                		tmp = v / (u - t1)
                	else:
                		tmp = (t1 / u) * (-v / u)
                	return tmp
                
                function code(u, v, t1)
                	tmp = 0.0
                	if ((t1 <= -9.5e-75) || !(t1 <= 8.2e-119))
                		tmp = Float64(v / Float64(u - t1));
                	else
                		tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u));
                	end
                	return tmp
                end
                
                function tmp_2 = code(u, v, t1)
                	tmp = 0.0;
                	if ((t1 <= -9.5e-75) || ~((t1 <= 8.2e-119)))
                		tmp = v / (u - t1);
                	else
                		tmp = (t1 / u) * (-v / u);
                	end
                	tmp_2 = tmp;
                end
                
                code[u_, v_, t1_] := If[Or[LessEqual[t1, -9.5e-75], N[Not[LessEqual[t1, 8.2e-119]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;t1 \leq -9.5 \cdot 10^{-75} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\
                \;\;\;\;\frac{v}{u - t1}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if t1 < -9.4999999999999991e-75 or 8.20000000000000041e-119 < t1

                  1. Initial program 71.5%

                    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                  2. Add Preprocessing
                  3. Applied rewrites98.6%

                    \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                  4. Taylor expanded in u around 0

                    \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                  5. Step-by-step derivation
                    1. Applied rewrites82.8%

                      \[\leadsto \frac{\color{blue}{v}}{u - t1} \]

                    if -9.4999999999999991e-75 < t1 < 8.20000000000000041e-119

                    1. Initial program 84.0%

                      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in u around inf

                      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{{u}^{2}}} \]
                    4. Step-by-step derivation
                      1. Applied rewrites80.5%

                        \[\leadsto \color{blue}{\frac{-t1}{u} \cdot \frac{v}{u}} \]
                    5. Recombined 2 regimes into one program.
                    6. Final simplification82.1%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -9.5 \cdot 10^{-75} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 6: 93.9% accurate, 0.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq 3.1 \cdot 10^{+133}:\\ \;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u - t1}}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \end{array} \end{array} \]
                    (FPCore (u v t1)
                     :precision binary64
                     (if (<= u 3.1e+133)
                       (* (- v) (/ (/ t1 (- u t1)) (- u t1)))
                       (/ (* t1 (/ (- v) u)) u)))
                    double code(double u, double v, double t1) {
                    	double tmp;
                    	if (u <= 3.1e+133) {
                    		tmp = -v * ((t1 / (u - t1)) / (u - t1));
                    	} else {
                    		tmp = (t1 * (-v / u)) / u;
                    	}
                    	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(u, v, t1)
                    use fmin_fmax_functions
                        real(8), intent (in) :: u
                        real(8), intent (in) :: v
                        real(8), intent (in) :: t1
                        real(8) :: tmp
                        if (u <= 3.1d+133) then
                            tmp = -v * ((t1 / (u - t1)) / (u - t1))
                        else
                            tmp = (t1 * (-v / u)) / u
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double u, double v, double t1) {
                    	double tmp;
                    	if (u <= 3.1e+133) {
                    		tmp = -v * ((t1 / (u - t1)) / (u - t1));
                    	} else {
                    		tmp = (t1 * (-v / u)) / u;
                    	}
                    	return tmp;
                    }
                    
                    def code(u, v, t1):
                    	tmp = 0
                    	if u <= 3.1e+133:
                    		tmp = -v * ((t1 / (u - t1)) / (u - t1))
                    	else:
                    		tmp = (t1 * (-v / u)) / u
                    	return tmp
                    
                    function code(u, v, t1)
                    	tmp = 0.0
                    	if (u <= 3.1e+133)
                    		tmp = Float64(Float64(-v) * Float64(Float64(t1 / Float64(u - t1)) / Float64(u - t1)));
                    	else
                    		tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(u, v, t1)
                    	tmp = 0.0;
                    	if (u <= 3.1e+133)
                    		tmp = -v * ((t1 / (u - t1)) / (u - t1));
                    	else
                    		tmp = (t1 * (-v / u)) / u;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[u_, v_, t1_] := If[LessEqual[u, 3.1e+133], N[((-v) * N[(N[(t1 / N[(u - t1), $MachinePrecision]), $MachinePrecision] / N[(u - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;u \leq 3.1 \cdot 10^{+133}:\\
                    \;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u - t1}}{u - t1}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if u < 3.1e133

                      1. Initial program 74.9%

                        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                      2. Add Preprocessing
                      3. Applied rewrites96.8%

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

                          \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                        2. lift-neg.f64N/A

                          \[\leadsto \frac{\frac{t1}{u - t1} \cdot \color{blue}{\left(\mathsf{neg}\left(v\right)\right)}}{u - t1} \]
                        3. mul-1-negN/A

                          \[\leadsto \frac{\frac{t1}{u - t1} \cdot \color{blue}{\left(-1 \cdot v\right)}}{u - t1} \]
                        4. lower-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\frac{t1}{u - t1} \cdot \left(-1 \cdot v\right)}}{u - t1} \]
                        5. *-commutativeN/A

                          \[\leadsto \frac{\color{blue}{\left(-1 \cdot v\right) \cdot \frac{t1}{u - t1}}}{u - t1} \]
                        6. associate-/l*N/A

                          \[\leadsto \color{blue}{\left(-1 \cdot v\right) \cdot \frac{\frac{t1}{u - t1}}{u - t1}} \]
                        7. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(-1 \cdot v\right) \cdot \frac{\frac{t1}{u - t1}}{u - t1}} \]
                        8. mul-1-negN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(v\right)\right)} \cdot \frac{\frac{t1}{u - t1}}{u - t1} \]
                        9. lift-neg.f64N/A

                          \[\leadsto \color{blue}{\left(-v\right)} \cdot \frac{\frac{t1}{u - t1}}{u - t1} \]
                        10. lower-/.f6494.5

                          \[\leadsto \left(-v\right) \cdot \color{blue}{\frac{\frac{t1}{u - t1}}{u - t1}} \]
                      5. Applied rewrites94.5%

                        \[\leadsto \color{blue}{\left(-v\right) \cdot \frac{\frac{t1}{u - t1}}{u - t1}} \]

                      if 3.1e133 < u

                      1. Initial program 79.6%

                        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                      2. Add Preprocessing
                      3. Applied rewrites97.0%

                        \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                      4. Taylor expanded in u around 0

                        \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                      5. Step-by-step derivation
                        1. Applied rewrites40.1%

                          \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                        2. Taylor expanded in u around inf

                          \[\leadsto \frac{v}{\color{blue}{u}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites40.1%

                            \[\leadsto \frac{v}{\color{blue}{u}} \]
                          2. Taylor expanded in u around inf

                            \[\leadsto \frac{\color{blue}{-1 \cdot \frac{t1 \cdot v}{u}}}{u} \]
                          3. Step-by-step derivation
                            1. Applied rewrites99.9%

                              \[\leadsto \frac{\color{blue}{t1 \cdot \frac{-v}{u}}}{u} \]
                          4. Recombined 2 regimes into one program.
                          5. Add Preprocessing

                          Alternative 7: 75.3% accurate, 0.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\ \end{array} \end{array} \]
                          (FPCore (u v t1)
                           :precision binary64
                           (if (or (<= t1 -4e-84) (not (<= t1 8.2e-119)))
                             (/ v (- u t1))
                             (/ (* (- t1) v) (* u u))))
                          double code(double u, double v, double t1) {
                          	double tmp;
                          	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119)) {
                          		tmp = v / (u - t1);
                          	} else {
                          		tmp = (-t1 * v) / (u * u);
                          	}
                          	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(u, v, t1)
                          use fmin_fmax_functions
                              real(8), intent (in) :: u
                              real(8), intent (in) :: v
                              real(8), intent (in) :: t1
                              real(8) :: tmp
                              if ((t1 <= (-4d-84)) .or. (.not. (t1 <= 8.2d-119))) then
                                  tmp = v / (u - t1)
                              else
                                  tmp = (-t1 * v) / (u * u)
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double u, double v, double t1) {
                          	double tmp;
                          	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119)) {
                          		tmp = v / (u - t1);
                          	} else {
                          		tmp = (-t1 * v) / (u * u);
                          	}
                          	return tmp;
                          }
                          
                          def code(u, v, t1):
                          	tmp = 0
                          	if (t1 <= -4e-84) or not (t1 <= 8.2e-119):
                          		tmp = v / (u - t1)
                          	else:
                          		tmp = (-t1 * v) / (u * u)
                          	return tmp
                          
                          function code(u, v, t1)
                          	tmp = 0.0
                          	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119))
                          		tmp = Float64(v / Float64(u - t1));
                          	else
                          		tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(u, v, t1)
                          	tmp = 0.0;
                          	if ((t1 <= -4e-84) || ~((t1 <= 8.2e-119)))
                          		tmp = v / (u - t1);
                          	else
                          		tmp = (-t1 * v) / (u * u);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[u_, v_, t1_] := If[Or[LessEqual[t1, -4e-84], N[Not[LessEqual[t1, 8.2e-119]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\
                          \;\;\;\;\frac{v}{u - t1}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if t1 < -4.0000000000000001e-84 or 8.20000000000000041e-119 < t1

                            1. Initial program 71.1%

                              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                            2. Add Preprocessing
                            3. Applied rewrites98.7%

                              \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                            4. Taylor expanded in u around 0

                              \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                            5. Step-by-step derivation
                              1. Applied rewrites82.1%

                                \[\leadsto \frac{\color{blue}{v}}{u - t1} \]

                              if -4.0000000000000001e-84 < t1 < 8.20000000000000041e-119

                              1. Initial program 85.7%

                                \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in u around inf

                                \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{{u}^{2}}} \]
                              4. Step-by-step derivation
                                1. Applied rewrites81.5%

                                  \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{u \cdot u}} \]
                              5. Recombined 2 regimes into one program.
                              6. Final simplification81.9%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 8: 75.6% accurate, 0.8× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u \cdot u} \cdot t1\\ \end{array} \end{array} \]
                              (FPCore (u v t1)
                               :precision binary64
                               (if (or (<= t1 -4e-84) (not (<= t1 8.2e-119)))
                                 (/ v (- u t1))
                                 (* (/ (- v) (* u u)) t1)))
                              double code(double u, double v, double t1) {
                              	double tmp;
                              	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119)) {
                              		tmp = v / (u - t1);
                              	} else {
                              		tmp = (-v / (u * u)) * t1;
                              	}
                              	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(u, v, t1)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: u
                                  real(8), intent (in) :: v
                                  real(8), intent (in) :: t1
                                  real(8) :: tmp
                                  if ((t1 <= (-4d-84)) .or. (.not. (t1 <= 8.2d-119))) then
                                      tmp = v / (u - t1)
                                  else
                                      tmp = (-v / (u * u)) * t1
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double u, double v, double t1) {
                              	double tmp;
                              	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119)) {
                              		tmp = v / (u - t1);
                              	} else {
                              		tmp = (-v / (u * u)) * t1;
                              	}
                              	return tmp;
                              }
                              
                              def code(u, v, t1):
                              	tmp = 0
                              	if (t1 <= -4e-84) or not (t1 <= 8.2e-119):
                              		tmp = v / (u - t1)
                              	else:
                              		tmp = (-v / (u * u)) * t1
                              	return tmp
                              
                              function code(u, v, t1)
                              	tmp = 0.0
                              	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119))
                              		tmp = Float64(v / Float64(u - t1));
                              	else
                              		tmp = Float64(Float64(Float64(-v) / Float64(u * u)) * t1);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(u, v, t1)
                              	tmp = 0.0;
                              	if ((t1 <= -4e-84) || ~((t1 <= 8.2e-119)))
                              		tmp = v / (u - t1);
                              	else
                              		tmp = (-v / (u * u)) * t1;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[u_, v_, t1_] := If[Or[LessEqual[t1, -4e-84], N[Not[LessEqual[t1, 8.2e-119]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-v) / N[(u * u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\
                              \;\;\;\;\frac{v}{u - t1}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{-v}{u \cdot u} \cdot t1\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if t1 < -4.0000000000000001e-84 or 8.20000000000000041e-119 < t1

                                1. Initial program 71.1%

                                  \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                2. Add Preprocessing
                                3. Applied rewrites98.7%

                                  \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                                4. Taylor expanded in u around 0

                                  \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                5. Step-by-step derivation
                                  1. Applied rewrites82.1%

                                    \[\leadsto \frac{\color{blue}{v}}{u - t1} \]

                                  if -4.0000000000000001e-84 < t1 < 8.20000000000000041e-119

                                  1. Initial program 85.7%

                                    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in u around inf

                                    \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{{u}^{2}}} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites81.5%

                                      \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{u \cdot u}} \]
                                    2. Step-by-step derivation
                                      1. lift-/.f64N/A

                                        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{u \cdot u}} \]
                                      2. lift-*.f64N/A

                                        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{u \cdot u} \]
                                      3. associate-/l*N/A

                                        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{u \cdot u}} \]
                                      4. *-commutativeN/A

                                        \[\leadsto \color{blue}{\frac{v}{u \cdot u} \cdot \left(-t1\right)} \]
                                      5. lower-*.f64N/A

                                        \[\leadsto \color{blue}{\frac{v}{u \cdot u} \cdot \left(-t1\right)} \]
                                      6. lower-/.f6480.1

                                        \[\leadsto \color{blue}{\frac{v}{u \cdot u}} \cdot \left(-t1\right) \]
                                    3. Applied rewrites80.1%

                                      \[\leadsto \color{blue}{\frac{v}{u \cdot u} \cdot \left(-t1\right)} \]
                                  5. Recombined 2 regimes into one program.
                                  6. Final simplification81.5%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u \cdot u} \cdot t1\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 9: 75.5% accurate, 0.8× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\ \end{array} \end{array} \]
                                  (FPCore (u v t1)
                                   :precision binary64
                                   (if (or (<= t1 -4e-84) (not (<= t1 8.2e-119)))
                                     (/ v (- u t1))
                                     (* v (/ (- t1) (* u u)))))
                                  double code(double u, double v, double t1) {
                                  	double tmp;
                                  	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119)) {
                                  		tmp = v / (u - t1);
                                  	} else {
                                  		tmp = v * (-t1 / (u * u));
                                  	}
                                  	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(u, v, t1)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: u
                                      real(8), intent (in) :: v
                                      real(8), intent (in) :: t1
                                      real(8) :: tmp
                                      if ((t1 <= (-4d-84)) .or. (.not. (t1 <= 8.2d-119))) then
                                          tmp = v / (u - t1)
                                      else
                                          tmp = v * (-t1 / (u * u))
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double u, double v, double t1) {
                                  	double tmp;
                                  	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119)) {
                                  		tmp = v / (u - t1);
                                  	} else {
                                  		tmp = v * (-t1 / (u * u));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(u, v, t1):
                                  	tmp = 0
                                  	if (t1 <= -4e-84) or not (t1 <= 8.2e-119):
                                  		tmp = v / (u - t1)
                                  	else:
                                  		tmp = v * (-t1 / (u * u))
                                  	return tmp
                                  
                                  function code(u, v, t1)
                                  	tmp = 0.0
                                  	if ((t1 <= -4e-84) || !(t1 <= 8.2e-119))
                                  		tmp = Float64(v / Float64(u - t1));
                                  	else
                                  		tmp = Float64(v * Float64(Float64(-t1) / Float64(u * u)));
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(u, v, t1)
                                  	tmp = 0.0;
                                  	if ((t1 <= -4e-84) || ~((t1 <= 8.2e-119)))
                                  		tmp = v / (u - t1);
                                  	else
                                  		tmp = v * (-t1 / (u * u));
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[u_, v_, t1_] := If[Or[LessEqual[t1, -4e-84], N[Not[LessEqual[t1, 8.2e-119]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(v * N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\
                                  \;\;\;\;\frac{v}{u - t1}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if t1 < -4.0000000000000001e-84 or 8.20000000000000041e-119 < t1

                                    1. Initial program 71.1%

                                      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                    2. Add Preprocessing
                                    3. Applied rewrites98.7%

                                      \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                                    4. Taylor expanded in u around 0

                                      \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                    5. Step-by-step derivation
                                      1. Applied rewrites82.1%

                                        \[\leadsto \frac{\color{blue}{v}}{u - t1} \]

                                      if -4.0000000000000001e-84 < t1 < 8.20000000000000041e-119

                                      1. Initial program 85.7%

                                        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in u around inf

                                        \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{{u}^{2}}} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites81.5%

                                          \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{u \cdot u}} \]
                                        2. Step-by-step derivation
                                          1. lift-/.f64N/A

                                            \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{u \cdot u}} \]
                                          2. lift-*.f64N/A

                                            \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{u \cdot u} \]
                                          3. *-commutativeN/A

                                            \[\leadsto \frac{\color{blue}{v \cdot \left(-t1\right)}}{u \cdot u} \]
                                          4. associate-/l*N/A

                                            \[\leadsto \color{blue}{v \cdot \frac{-t1}{u \cdot u}} \]
                                          5. lower-*.f64N/A

                                            \[\leadsto \color{blue}{v \cdot \frac{-t1}{u \cdot u}} \]
                                          6. lower-/.f6478.0

                                            \[\leadsto v \cdot \color{blue}{\frac{-t1}{u \cdot u}} \]
                                        3. Applied rewrites78.0%

                                          \[\leadsto \color{blue}{v \cdot \frac{-t1}{u \cdot u}} \]
                                      5. Recombined 2 regimes into one program.
                                      6. Final simplification80.8%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{-84} \lor \neg \left(t1 \leq 8.2 \cdot 10^{-119}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\ \end{array} \]
                                      7. Add Preprocessing

                                      Alternative 10: 58.9% accurate, 1.2× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -5.8 \cdot 10^{+152} \lor \neg \left(u \leq 1.3 \cdot 10^{+133}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
                                      (FPCore (u v t1)
                                       :precision binary64
                                       (if (or (<= u -5.8e+152) (not (<= u 1.3e+133))) (/ v u) (/ (- v) t1)))
                                      double code(double u, double v, double t1) {
                                      	double tmp;
                                      	if ((u <= -5.8e+152) || !(u <= 1.3e+133)) {
                                      		tmp = v / u;
                                      	} else {
                                      		tmp = -v / t1;
                                      	}
                                      	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(u, v, t1)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: u
                                          real(8), intent (in) :: v
                                          real(8), intent (in) :: t1
                                          real(8) :: tmp
                                          if ((u <= (-5.8d+152)) .or. (.not. (u <= 1.3d+133))) then
                                              tmp = v / u
                                          else
                                              tmp = -v / t1
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double u, double v, double t1) {
                                      	double tmp;
                                      	if ((u <= -5.8e+152) || !(u <= 1.3e+133)) {
                                      		tmp = v / u;
                                      	} else {
                                      		tmp = -v / t1;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(u, v, t1):
                                      	tmp = 0
                                      	if (u <= -5.8e+152) or not (u <= 1.3e+133):
                                      		tmp = v / u
                                      	else:
                                      		tmp = -v / t1
                                      	return tmp
                                      
                                      function code(u, v, t1)
                                      	tmp = 0.0
                                      	if ((u <= -5.8e+152) || !(u <= 1.3e+133))
                                      		tmp = Float64(v / u);
                                      	else
                                      		tmp = Float64(Float64(-v) / t1);
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(u, v, t1)
                                      	tmp = 0.0;
                                      	if ((u <= -5.8e+152) || ~((u <= 1.3e+133)))
                                      		tmp = v / u;
                                      	else
                                      		tmp = -v / t1;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[u_, v_, t1_] := If[Or[LessEqual[u, -5.8e+152], N[Not[LessEqual[u, 1.3e+133]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;u \leq -5.8 \cdot 10^{+152} \lor \neg \left(u \leq 1.3 \cdot 10^{+133}\right):\\
                                      \;\;\;\;\frac{v}{u}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{-v}{t1}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if u < -5.7999999999999997e152 or 1.2999999999999999e133 < u

                                        1. Initial program 75.1%

                                          \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                        2. Add Preprocessing
                                        3. Applied rewrites95.7%

                                          \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                                        4. Taylor expanded in u around 0

                                          \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                        5. Step-by-step derivation
                                          1. Applied rewrites48.6%

                                            \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                          2. Taylor expanded in u around inf

                                            \[\leadsto \frac{v}{\color{blue}{u}} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites44.3%

                                              \[\leadsto \frac{v}{\color{blue}{u}} \]

                                            if -5.7999999999999997e152 < u < 1.2999999999999999e133

                                            1. Initial program 75.6%

                                              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in u around 0

                                              \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites70.6%

                                                \[\leadsto \color{blue}{\frac{v}{-t1}} \]
                                            5. Recombined 2 regimes into one program.
                                            6. Final simplification63.9%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5.8 \cdot 10^{+152} \lor \neg \left(u \leq 1.3 \cdot 10^{+133}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
                                            7. Add Preprocessing

                                            Alternative 11: 61.8% accurate, 2.0× speedup?

                                            \[\begin{array}{l} \\ \frac{v}{u - t1} \end{array} \]
                                            (FPCore (u v t1) :precision binary64 (/ v (- u t1)))
                                            double code(double u, double v, double t1) {
                                            	return v / (u - t1);
                                            }
                                            
                                            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(u, v, t1)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: u
                                                real(8), intent (in) :: v
                                                real(8), intent (in) :: t1
                                                code = v / (u - t1)
                                            end function
                                            
                                            public static double code(double u, double v, double t1) {
                                            	return v / (u - t1);
                                            }
                                            
                                            def code(u, v, t1):
                                            	return v / (u - t1)
                                            
                                            function code(u, v, t1)
                                            	return Float64(v / Float64(u - t1))
                                            end
                                            
                                            function tmp = code(u, v, t1)
                                            	tmp = v / (u - t1);
                                            end
                                            
                                            code[u_, v_, t1_] := N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \frac{v}{u - t1}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 75.5%

                                              \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                            2. Add Preprocessing
                                            3. Applied rewrites96.9%

                                              \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                                            4. Taylor expanded in u around 0

                                              \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                            5. Step-by-step derivation
                                              1. Applied rewrites65.9%

                                                \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                              2. Final simplification65.9%

                                                \[\leadsto \frac{v}{u - t1} \]
                                              3. Add Preprocessing

                                              Alternative 12: 16.6% accurate, 2.5× speedup?

                                              \[\begin{array}{l} \\ \frac{v}{u} \end{array} \]
                                              (FPCore (u v t1) :precision binary64 (/ v u))
                                              double code(double u, double v, double t1) {
                                              	return v / u;
                                              }
                                              
                                              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(u, v, t1)
                                              use fmin_fmax_functions
                                                  real(8), intent (in) :: u
                                                  real(8), intent (in) :: v
                                                  real(8), intent (in) :: t1
                                                  code = v / u
                                              end function
                                              
                                              public static double code(double u, double v, double t1) {
                                              	return v / u;
                                              }
                                              
                                              def code(u, v, t1):
                                              	return v / u
                                              
                                              function code(u, v, t1)
                                              	return Float64(v / u)
                                              end
                                              
                                              function tmp = code(u, v, t1)
                                              	tmp = v / u;
                                              end
                                              
                                              code[u_, v_, t1_] := N[(v / u), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \frac{v}{u}
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 75.5%

                                                \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                              2. Add Preprocessing
                                              3. Applied rewrites96.9%

                                                \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot \left(-v\right)}{u - t1}} \]
                                              4. Taylor expanded in u around 0

                                                \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                              5. Step-by-step derivation
                                                1. Applied rewrites65.9%

                                                  \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                                2. Taylor expanded in u around inf

                                                  \[\leadsto \frac{v}{\color{blue}{u}} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites18.8%

                                                    \[\leadsto \frac{v}{\color{blue}{u}} \]
                                                  2. Final simplification18.8%

                                                    \[\leadsto \frac{v}{u} \]
                                                  3. Add Preprocessing

                                                  Reproduce

                                                  ?
                                                  herbie shell --seed 2025020 
                                                  (FPCore (u v t1)
                                                    :name "Rosa's DopplerBench"
                                                    :precision binary64
                                                    (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))