Rosa's DopplerBench

Percentage Accurate: 73.3% → 97.9%
Time: 5.9s
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: 73.3% 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: 97.9% accurate, 0.8× speedup?

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

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

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

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

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

        \[\leadsto \frac{\left(-t1\right) \cdot \frac{v}{u + t1}}{\color{blue}{u + t1}} \]
      2. Final simplification98.8%

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

      Alternative 2: 87.4% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.45 \cdot 10^{+30}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq -3.4 \cdot 10^{-162}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \end{array} \]
      (FPCore (u v t1)
       :precision binary64
       (if (<= t1 -1.45e+30)
         (/ v (- u t1))
         (if (<= t1 -3.4e-162)
           (/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))
           (if (<= t1 6.7e-164)
             (/ (* t1 (/ (- v) u)) u)
             (if (<= t1 2.05e+108)
               (* (/ (- v) (* (+ u t1) (+ u t1))) t1)
               (/ (- v) (+ u t1)))))))
      double code(double u, double v, double t1) {
      	double tmp;
      	if (t1 <= -1.45e+30) {
      		tmp = v / (u - t1);
      	} else if (t1 <= -3.4e-162) {
      		tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
      	} else if (t1 <= 6.7e-164) {
      		tmp = (t1 * (-v / u)) / u;
      	} else if (t1 <= 2.05e+108) {
      		tmp = (-v / ((u + t1) * (u + t1))) * t1;
      	} else {
      		tmp = -v / (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 <= (-1.45d+30)) then
              tmp = v / (u - t1)
          else if (t1 <= (-3.4d-162)) then
              tmp = (-t1 * v) / ((t1 + u) * (t1 + u))
          else if (t1 <= 6.7d-164) then
              tmp = (t1 * (-v / u)) / u
          else if (t1 <= 2.05d+108) then
              tmp = (-v / ((u + t1) * (u + t1))) * t1
          else
              tmp = -v / (u + t1)
          end if
          code = tmp
      end function
      
      public static double code(double u, double v, double t1) {
      	double tmp;
      	if (t1 <= -1.45e+30) {
      		tmp = v / (u - t1);
      	} else if (t1 <= -3.4e-162) {
      		tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
      	} else if (t1 <= 6.7e-164) {
      		tmp = (t1 * (-v / u)) / u;
      	} else if (t1 <= 2.05e+108) {
      		tmp = (-v / ((u + t1) * (u + t1))) * t1;
      	} else {
      		tmp = -v / (u + t1);
      	}
      	return tmp;
      }
      
      def code(u, v, t1):
      	tmp = 0
      	if t1 <= -1.45e+30:
      		tmp = v / (u - t1)
      	elif t1 <= -3.4e-162:
      		tmp = (-t1 * v) / ((t1 + u) * (t1 + u))
      	elif t1 <= 6.7e-164:
      		tmp = (t1 * (-v / u)) / u
      	elif t1 <= 2.05e+108:
      		tmp = (-v / ((u + t1) * (u + t1))) * t1
      	else:
      		tmp = -v / (u + t1)
      	return tmp
      
      function code(u, v, t1)
      	tmp = 0.0
      	if (t1 <= -1.45e+30)
      		tmp = Float64(v / Float64(u - t1));
      	elseif (t1 <= -3.4e-162)
      		tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)));
      	elseif (t1 <= 6.7e-164)
      		tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u);
      	elseif (t1 <= 2.05e+108)
      		tmp = Float64(Float64(Float64(-v) / Float64(Float64(u + t1) * Float64(u + t1))) * t1);
      	else
      		tmp = Float64(Float64(-v) / Float64(u + t1));
      	end
      	return tmp
      end
      
      function tmp_2 = code(u, v, t1)
      	tmp = 0.0;
      	if (t1 <= -1.45e+30)
      		tmp = v / (u - t1);
      	elseif (t1 <= -3.4e-162)
      		tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
      	elseif (t1 <= 6.7e-164)
      		tmp = (t1 * (-v / u)) / u;
      	elseif (t1 <= 2.05e+108)
      		tmp = (-v / ((u + t1) * (u + t1))) * t1;
      	else
      		tmp = -v / (u + t1);
      	end
      	tmp_2 = tmp;
      end
      
      code[u_, v_, t1_] := If[LessEqual[t1, -1.45e+30], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -3.4e-162], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.7e-164], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[t1, 2.05e+108], N[(N[((-v) / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t1 \leq -1.45 \cdot 10^{+30}:\\
      \;\;\;\;\frac{v}{u - t1}\\
      
      \mathbf{elif}\;t1 \leq -3.4 \cdot 10^{-162}:\\
      \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
      
      \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\
      \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
      
      \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\
      \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-v}{u + t1}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 5 regimes
      2. if t1 < -1.4499999999999999e30

        1. Initial program 52.4%

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

          \[\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 rewrites93.2%

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

          if -1.4499999999999999e30 < t1 < -3.4e-162

          1. Initial program 94.3%

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

          if -3.4e-162 < t1 < 6.69999999999999999e-164

          1. Initial program 72.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}{\frac{-1 \cdot \left(t1 \cdot v\right) + 2 \cdot \frac{{t1}^{2} \cdot v}{u}}{{u}^{2}}} \]
          4. Step-by-step derivation
            1. Applied rewrites83.8%

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

              \[\leadsto \frac{-1 \cdot \frac{t1 \cdot v}{u}}{u} \]
            3. Step-by-step derivation
              1. Applied rewrites88.6%

                \[\leadsto \frac{t1 \cdot \frac{-v}{u}}{u} \]

              if 6.69999999999999999e-164 < t1 < 2.05e108

              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 v around 0

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

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

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

                  if 2.05e108 < t1

                  1. Initial program 55.0%

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

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

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

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

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

                          \[\leadsto \frac{-v}{\color{blue}{u} + t1} \]
                      4. Recombined 5 regimes into one program.
                      5. Final simplification90.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.45 \cdot 10^{+30}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq -3.4 \cdot 10^{-162}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \]
                      6. Add Preprocessing

                      Alternative 3: 87.9% accurate, 0.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+121}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq -1.8 \cdot 10^{-140}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \end{array} \]
                      (FPCore (u v t1)
                       :precision binary64
                       (let* ((t_1 (* (/ (- v) (* (+ u t1) (+ u t1))) t1)))
                         (if (<= t1 -1.3e+121)
                           (/ v (- u t1))
                           (if (<= t1 -1.8e-140)
                             t_1
                             (if (<= t1 6.7e-164)
                               (/ (* t1 (/ (- v) u)) u)
                               (if (<= t1 2.05e+108) t_1 (/ (- v) (+ u t1))))))))
                      double code(double u, double v, double t1) {
                      	double t_1 = (-v / ((u + t1) * (u + t1))) * t1;
                      	double tmp;
                      	if (t1 <= -1.3e+121) {
                      		tmp = v / (u - t1);
                      	} else if (t1 <= -1.8e-140) {
                      		tmp = t_1;
                      	} else if (t1 <= 6.7e-164) {
                      		tmp = (t1 * (-v / u)) / u;
                      	} else if (t1 <= 2.05e+108) {
                      		tmp = t_1;
                      	} else {
                      		tmp = -v / (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) :: t_1
                          real(8) :: tmp
                          t_1 = (-v / ((u + t1) * (u + t1))) * t1
                          if (t1 <= (-1.3d+121)) then
                              tmp = v / (u - t1)
                          else if (t1 <= (-1.8d-140)) then
                              tmp = t_1
                          else if (t1 <= 6.7d-164) then
                              tmp = (t1 * (-v / u)) / u
                          else if (t1 <= 2.05d+108) then
                              tmp = t_1
                          else
                              tmp = -v / (u + t1)
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double u, double v, double t1) {
                      	double t_1 = (-v / ((u + t1) * (u + t1))) * t1;
                      	double tmp;
                      	if (t1 <= -1.3e+121) {
                      		tmp = v / (u - t1);
                      	} else if (t1 <= -1.8e-140) {
                      		tmp = t_1;
                      	} else if (t1 <= 6.7e-164) {
                      		tmp = (t1 * (-v / u)) / u;
                      	} else if (t1 <= 2.05e+108) {
                      		tmp = t_1;
                      	} else {
                      		tmp = -v / (u + t1);
                      	}
                      	return tmp;
                      }
                      
                      def code(u, v, t1):
                      	t_1 = (-v / ((u + t1) * (u + t1))) * t1
                      	tmp = 0
                      	if t1 <= -1.3e+121:
                      		tmp = v / (u - t1)
                      	elif t1 <= -1.8e-140:
                      		tmp = t_1
                      	elif t1 <= 6.7e-164:
                      		tmp = (t1 * (-v / u)) / u
                      	elif t1 <= 2.05e+108:
                      		tmp = t_1
                      	else:
                      		tmp = -v / (u + t1)
                      	return tmp
                      
                      function code(u, v, t1)
                      	t_1 = Float64(Float64(Float64(-v) / Float64(Float64(u + t1) * Float64(u + t1))) * t1)
                      	tmp = 0.0
                      	if (t1 <= -1.3e+121)
                      		tmp = Float64(v / Float64(u - t1));
                      	elseif (t1 <= -1.8e-140)
                      		tmp = t_1;
                      	elseif (t1 <= 6.7e-164)
                      		tmp = Float64(Float64(t1 * Float64(Float64(-v) / u)) / u);
                      	elseif (t1 <= 2.05e+108)
                      		tmp = t_1;
                      	else
                      		tmp = Float64(Float64(-v) / Float64(u + t1));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(u, v, t1)
                      	t_1 = (-v / ((u + t1) * (u + t1))) * t1;
                      	tmp = 0.0;
                      	if (t1 <= -1.3e+121)
                      		tmp = v / (u - t1);
                      	elseif (t1 <= -1.8e-140)
                      		tmp = t_1;
                      	elseif (t1 <= 6.7e-164)
                      		tmp = (t1 * (-v / u)) / u;
                      	elseif (t1 <= 2.05e+108)
                      		tmp = t_1;
                      	else
                      		tmp = -v / (u + t1);
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-v) / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision]}, If[LessEqual[t1, -1.3e+121], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.8e-140], t$95$1, If[LessEqual[t1, 6.7e-164], N[(N[(t1 * N[((-v) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[t1, 2.05e+108], t$95$1, N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := \frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\
                      \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+121}:\\
                      \;\;\;\;\frac{v}{u - t1}\\
                      
                      \mathbf{elif}\;t1 \leq -1.8 \cdot 10^{-140}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\
                      \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\
                      
                      \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{-v}{u + t1}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if t1 < -1.2999999999999999e121

                        1. Initial program 46.4%

                          \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                        2. Add Preprocessing
                        3. Applied rewrites100.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 rewrites100.0%

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

                          if -1.2999999999999999e121 < t1 < -1.8e-140 or 6.69999999999999999e-164 < t1 < 2.05e108

                          1. Initial program 85.0%

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

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

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

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

                              if -1.8e-140 < t1 < 6.69999999999999999e-164

                              1. Initial program 72.5%

                                \[\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}{\frac{-1 \cdot \left(t1 \cdot v\right) + 2 \cdot \frac{{t1}^{2} \cdot v}{u}}{{u}^{2}}} \]
                              4. Step-by-step derivation
                                1. Applied rewrites83.3%

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

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

                                    \[\leadsto \frac{t1 \cdot \frac{-v}{u}}{u} \]

                                  if 2.05e108 < t1

                                  1. Initial program 55.0%

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

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

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

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+121}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq -1.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \]
                                      6. Add Preprocessing

                                      Alternative 4: 87.9% accurate, 0.6× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+121}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \end{array} \]
                                      (FPCore (u v t1)
                                       :precision binary64
                                       (let* ((t_1 (* (/ (- v) (* (+ u t1) (+ u t1))) t1)))
                                         (if (<= t1 -1.3e+121)
                                           (/ v (- u t1))
                                           (if (<= t1 -4.5e-142)
                                             t_1
                                             (if (<= t1 6.7e-164)
                                               (* (/ t1 u) (/ (- v) u))
                                               (if (<= t1 2.05e+108) t_1 (/ (- v) (+ u t1))))))))
                                      double code(double u, double v, double t1) {
                                      	double t_1 = (-v / ((u + t1) * (u + t1))) * t1;
                                      	double tmp;
                                      	if (t1 <= -1.3e+121) {
                                      		tmp = v / (u - t1);
                                      	} else if (t1 <= -4.5e-142) {
                                      		tmp = t_1;
                                      	} else if (t1 <= 6.7e-164) {
                                      		tmp = (t1 / u) * (-v / u);
                                      	} else if (t1 <= 2.05e+108) {
                                      		tmp = t_1;
                                      	} else {
                                      		tmp = -v / (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) :: t_1
                                          real(8) :: tmp
                                          t_1 = (-v / ((u + t1) * (u + t1))) * t1
                                          if (t1 <= (-1.3d+121)) then
                                              tmp = v / (u - t1)
                                          else if (t1 <= (-4.5d-142)) then
                                              tmp = t_1
                                          else if (t1 <= 6.7d-164) then
                                              tmp = (t1 / u) * (-v / u)
                                          else if (t1 <= 2.05d+108) then
                                              tmp = t_1
                                          else
                                              tmp = -v / (u + t1)
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double u, double v, double t1) {
                                      	double t_1 = (-v / ((u + t1) * (u + t1))) * t1;
                                      	double tmp;
                                      	if (t1 <= -1.3e+121) {
                                      		tmp = v / (u - t1);
                                      	} else if (t1 <= -4.5e-142) {
                                      		tmp = t_1;
                                      	} else if (t1 <= 6.7e-164) {
                                      		tmp = (t1 / u) * (-v / u);
                                      	} else if (t1 <= 2.05e+108) {
                                      		tmp = t_1;
                                      	} else {
                                      		tmp = -v / (u + t1);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(u, v, t1):
                                      	t_1 = (-v / ((u + t1) * (u + t1))) * t1
                                      	tmp = 0
                                      	if t1 <= -1.3e+121:
                                      		tmp = v / (u - t1)
                                      	elif t1 <= -4.5e-142:
                                      		tmp = t_1
                                      	elif t1 <= 6.7e-164:
                                      		tmp = (t1 / u) * (-v / u)
                                      	elif t1 <= 2.05e+108:
                                      		tmp = t_1
                                      	else:
                                      		tmp = -v / (u + t1)
                                      	return tmp
                                      
                                      function code(u, v, t1)
                                      	t_1 = Float64(Float64(Float64(-v) / Float64(Float64(u + t1) * Float64(u + t1))) * t1)
                                      	tmp = 0.0
                                      	if (t1 <= -1.3e+121)
                                      		tmp = Float64(v / Float64(u - t1));
                                      	elseif (t1 <= -4.5e-142)
                                      		tmp = t_1;
                                      	elseif (t1 <= 6.7e-164)
                                      		tmp = Float64(Float64(t1 / u) * Float64(Float64(-v) / u));
                                      	elseif (t1 <= 2.05e+108)
                                      		tmp = t_1;
                                      	else
                                      		tmp = Float64(Float64(-v) / Float64(u + t1));
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(u, v, t1)
                                      	t_1 = (-v / ((u + t1) * (u + t1))) * t1;
                                      	tmp = 0.0;
                                      	if (t1 <= -1.3e+121)
                                      		tmp = v / (u - t1);
                                      	elseif (t1 <= -4.5e-142)
                                      		tmp = t_1;
                                      	elseif (t1 <= 6.7e-164)
                                      		tmp = (t1 / u) * (-v / u);
                                      	elseif (t1 <= 2.05e+108)
                                      		tmp = t_1;
                                      	else
                                      		tmp = -v / (u + t1);
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-v) / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision]}, If[LessEqual[t1, -1.3e+121], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -4.5e-142], t$95$1, If[LessEqual[t1, 6.7e-164], N[(N[(t1 / u), $MachinePrecision] * N[((-v) / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.05e+108], t$95$1, N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_1 := \frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\
                                      \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+121}:\\
                                      \;\;\;\;\frac{v}{u - t1}\\
                                      
                                      \mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-142}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\
                                      \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\
                                      
                                      \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{-v}{u + t1}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 4 regimes
                                      2. if t1 < -1.2999999999999999e121

                                        1. Initial program 46.4%

                                          \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                        2. Add Preprocessing
                                        3. Applied rewrites100.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 rewrites100.0%

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

                                          if -1.2999999999999999e121 < t1 < -4.50000000000000019e-142 or 6.69999999999999999e-164 < t1 < 2.05e108

                                          1. Initial program 85.0%

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

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

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

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

                                              if -4.50000000000000019e-142 < t1 < 6.69999999999999999e-164

                                              1. Initial program 72.5%

                                                \[\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 rewrites87.8%

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

                                                if 2.05e108 < t1

                                                1. Initial program 55.0%

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

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

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

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

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

                                                        \[\leadsto \frac{-v}{\color{blue}{u} + t1} \]
                                                    4. Recombined 4 regimes into one program.
                                                    5. Final simplification89.7%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+121}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-142}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{elif}\;t1 \leq 6.7 \cdot 10^{-164}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{-v}{u}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \]
                                                    6. Add Preprocessing

                                                    Alternative 5: 90.0% accurate, 0.6× speedup?

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

                                                      1. Initial program 41.9%

                                                        \[\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 rewrites100.0%

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

                                                        if -1.45000000000000007e142 < t1 < 4.60000000000000015e138

                                                        1. Initial program 80.0%

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

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

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

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

                                                            if 4.60000000000000015e138 < t1

                                                            1. Initial program 53.1%

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

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

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

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

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

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

                                                                Alternative 6: 86.0% accurate, 0.7× speedup?

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

                                                                  1. Initial program 46.4%

                                                                    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
                                                                  2. Add Preprocessing
                                                                  3. Applied rewrites100.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 rewrites100.0%

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

                                                                    if -1.2999999999999999e121 < t1 < 2.05e108

                                                                    1. Initial program 80.1%

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

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

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

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

                                                                        if 2.05e108 < t1

                                                                        1. Initial program 55.0%

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

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

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

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

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

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

                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+121}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{+108}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \]
                                                                            6. Add Preprocessing

                                                                            Alternative 7: 76.2% accurate, 0.8× speedup?

                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -5.1 \cdot 10^{-108} \lor \neg \left(t1 \leq 4.5 \cdot 10^{-19}\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 -5.1e-108) (not (<= t1 4.5e-19)))
                                                                               (/ v (- u t1))
                                                                               (* (/ (- v) (* u u)) t1)))
                                                                            double code(double u, double v, double t1) {
                                                                            	double tmp;
                                                                            	if ((t1 <= -5.1e-108) || !(t1 <= 4.5e-19)) {
                                                                            		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 <= (-5.1d-108)) .or. (.not. (t1 <= 4.5d-19))) 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 <= -5.1e-108) || !(t1 <= 4.5e-19)) {
                                                                            		tmp = v / (u - t1);
                                                                            	} else {
                                                                            		tmp = (-v / (u * u)) * t1;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            def code(u, v, t1):
                                                                            	tmp = 0
                                                                            	if (t1 <= -5.1e-108) or not (t1 <= 4.5e-19):
                                                                            		tmp = v / (u - t1)
                                                                            	else:
                                                                            		tmp = (-v / (u * u)) * t1
                                                                            	return tmp
                                                                            
                                                                            function code(u, v, t1)
                                                                            	tmp = 0.0
                                                                            	if ((t1 <= -5.1e-108) || !(t1 <= 4.5e-19))
                                                                            		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 <= -5.1e-108) || ~((t1 <= 4.5e-19)))
                                                                            		tmp = v / (u - t1);
                                                                            	else
                                                                            		tmp = (-v / (u * u)) * t1;
                                                                            	end
                                                                            	tmp_2 = tmp;
                                                                            end
                                                                            
                                                                            code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.1e-108], N[Not[LessEqual[t1, 4.5e-19]], $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 -5.1 \cdot 10^{-108} \lor \neg \left(t1 \leq 4.5 \cdot 10^{-19}\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 < -5.1000000000000002e-108 or 4.50000000000000013e-19 < t1

                                                                              1. Initial program 66.3%

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

                                                                                \[\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 rewrites83.1%

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

                                                                                if -5.1000000000000002e-108 < t1 < 4.50000000000000013e-19

                                                                                1. Initial program 77.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 inf

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

                                                                                    \[\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-/.f6471.8

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

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

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

                                                                                Alternative 8: 76.2% accurate, 0.8× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -5.1 \cdot 10^{-108} \lor \neg \left(t1 \leq 4.5 \cdot 10^{-19}\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 -5.1e-108) (not (<= t1 4.5e-19)))
                                                                                   (/ v (- u t1))
                                                                                   (* v (/ (- t1) (* u u)))))
                                                                                double code(double u, double v, double t1) {
                                                                                	double tmp;
                                                                                	if ((t1 <= -5.1e-108) || !(t1 <= 4.5e-19)) {
                                                                                		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 <= (-5.1d-108)) .or. (.not. (t1 <= 4.5d-19))) 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 <= -5.1e-108) || !(t1 <= 4.5e-19)) {
                                                                                		tmp = v / (u - t1);
                                                                                	} else {
                                                                                		tmp = v * (-t1 / (u * u));
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                def code(u, v, t1):
                                                                                	tmp = 0
                                                                                	if (t1 <= -5.1e-108) or not (t1 <= 4.5e-19):
                                                                                		tmp = v / (u - t1)
                                                                                	else:
                                                                                		tmp = v * (-t1 / (u * u))
                                                                                	return tmp
                                                                                
                                                                                function code(u, v, t1)
                                                                                	tmp = 0.0
                                                                                	if ((t1 <= -5.1e-108) || !(t1 <= 4.5e-19))
                                                                                		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 <= -5.1e-108) || ~((t1 <= 4.5e-19)))
                                                                                		tmp = v / (u - t1);
                                                                                	else
                                                                                		tmp = v * (-t1 / (u * u));
                                                                                	end
                                                                                	tmp_2 = tmp;
                                                                                end
                                                                                
                                                                                code[u_, v_, t1_] := If[Or[LessEqual[t1, -5.1e-108], N[Not[LessEqual[t1, 4.5e-19]], $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 -5.1 \cdot 10^{-108} \lor \neg \left(t1 \leq 4.5 \cdot 10^{-19}\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 < -5.1000000000000002e-108 or 4.50000000000000013e-19 < t1

                                                                                  1. Initial program 66.3%

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

                                                                                    \[\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 rewrites83.1%

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

                                                                                    if -5.1000000000000002e-108 < t1 < 4.50000000000000013e-19

                                                                                    1. Initial program 77.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 inf

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

                                                                                        \[\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-/.f6471.7

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

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

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

                                                                                    Alternative 9: 67.6% accurate, 0.9× speedup?

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

                                                                                      1. Initial program 77.0%

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

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

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

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

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

                                                                                          if -7.4000000000000003e130 < u < 3.5e121

                                                                                          1. Initial program 68.3%

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

                                                                                            \[\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 rewrites68.9%

                                                                                              \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                                                                          6. Recombined 2 regimes into one program.
                                                                                          7. Final simplification70.2%

                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -7.4 \cdot 10^{+130} \lor \neg \left(u \leq 3.5 \cdot 10^{+121}\right):\\ \;\;\;\;v \cdot \frac{t1}{u \cdot u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u - t1}\\ \end{array} \]
                                                                                          8. Add Preprocessing

                                                                                          Alternative 10: 57.6% accurate, 1.2× speedup?

                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.4 \cdot 10^{+132} \lor \neg \left(u \leq 1.36 \cdot 10^{+221}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \end{array} \]
                                                                                          (FPCore (u v t1)
                                                                                           :precision binary64
                                                                                           (if (or (<= u -2.4e+132) (not (<= u 1.36e+221))) (/ v u) (/ v (- t1))))
                                                                                          double code(double u, double v, double t1) {
                                                                                          	double tmp;
                                                                                          	if ((u <= -2.4e+132) || !(u <= 1.36e+221)) {
                                                                                          		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 <= (-2.4d+132)) .or. (.not. (u <= 1.36d+221))) 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 <= -2.4e+132) || !(u <= 1.36e+221)) {
                                                                                          		tmp = v / u;
                                                                                          	} else {
                                                                                          		tmp = v / -t1;
                                                                                          	}
                                                                                          	return tmp;
                                                                                          }
                                                                                          
                                                                                          def code(u, v, t1):
                                                                                          	tmp = 0
                                                                                          	if (u <= -2.4e+132) or not (u <= 1.36e+221):
                                                                                          		tmp = v / u
                                                                                          	else:
                                                                                          		tmp = v / -t1
                                                                                          	return tmp
                                                                                          
                                                                                          function code(u, v, t1)
                                                                                          	tmp = 0.0
                                                                                          	if ((u <= -2.4e+132) || !(u <= 1.36e+221))
                                                                                          		tmp = Float64(v / u);
                                                                                          	else
                                                                                          		tmp = Float64(v / Float64(-t1));
                                                                                          	end
                                                                                          	return tmp
                                                                                          end
                                                                                          
                                                                                          function tmp_2 = code(u, v, t1)
                                                                                          	tmp = 0.0;
                                                                                          	if ((u <= -2.4e+132) || ~((u <= 1.36e+221)))
                                                                                          		tmp = v / u;
                                                                                          	else
                                                                                          		tmp = v / -t1;
                                                                                          	end
                                                                                          	tmp_2 = tmp;
                                                                                          end
                                                                                          
                                                                                          code[u_, v_, t1_] := If[Or[LessEqual[u, -2.4e+132], N[Not[LessEqual[u, 1.36e+221]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
                                                                                          
                                                                                          \begin{array}{l}
                                                                                          
                                                                                          \\
                                                                                          \begin{array}{l}
                                                                                          \mathbf{if}\;u \leq -2.4 \cdot 10^{+132} \lor \neg \left(u \leq 1.36 \cdot 10^{+221}\right):\\
                                                                                          \;\;\;\;\frac{v}{u}\\
                                                                                          
                                                                                          \mathbf{else}:\\
                                                                                          \;\;\;\;\frac{v}{-t1}\\
                                                                                          
                                                                                          
                                                                                          \end{array}
                                                                                          \end{array}
                                                                                          
                                                                                          Derivation
                                                                                          1. Split input into 2 regimes
                                                                                          2. if u < -2.4000000000000001e132 or 1.36e221 < u

                                                                                            1. Initial program 89.0%

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

                                                                                              \[\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 rewrites46.0%

                                                                                                \[\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 rewrites46.0%

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

                                                                                                if -2.4000000000000001e132 < u < 1.36e221

                                                                                                1. Initial program 66.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 rewrites63.6%

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

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

                                                                                                Alternative 11: 60.9% 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 70.5%

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

                                                                                                  \[\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 rewrites61.8%

                                                                                                    \[\leadsto \frac{\color{blue}{v}}{u - t1} \]
                                                                                                  2. Add Preprocessing

                                                                                                  Alternative 12: 17.0% 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 70.5%

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

                                                                                                    \[\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 rewrites61.8%

                                                                                                      \[\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 rewrites13.4%

                                                                                                        \[\leadsto \frac{v}{\color{blue}{u}} \]
                                                                                                      2. Add Preprocessing

                                                                                                      Reproduce

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