Rosa's DopplerBench

Percentage Accurate: 73.8% → 96.8%
Time: 7.1s
Alternatives: 10
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 10 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.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(u, v, t1)
use fmin_fmax_functions
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 96.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{\frac{t1}{u - t1} \cdot v}{\left(-u\right) + t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (/ t1 (- u t1)) v) (+ (- u) t1)))
double code(double u, double v, double t1) {
	return ((t1 / (u - t1)) * v) / (-u + t1);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(u, v, t1)
use fmin_fmax_functions
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = ((t1 / (u - t1)) * v) / (-u + t1)
end function
public static double code(double u, double v, double t1) {
	return ((t1 / (u - t1)) * v) / (-u + t1);
}
def code(u, v, t1):
	return ((t1 / (u - t1)) * v) / (-u + t1)
function code(u, v, t1)
	return Float64(Float64(Float64(t1 / Float64(u - t1)) * v) / Float64(Float64(-u) + t1))
end
function tmp = code(u, v, t1)
	tmp = ((t1 / (u - t1)) * v) / (-u + t1);
end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(u - t1), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[((-u) + t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

Alternative 2: 87.4% 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.15 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1 \cdot v}{\left(-u\right) + t1}\\ \mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-163}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 2.6 \cdot 10^{-142}:\\ \;\;\;\;\frac{\frac{v \cdot t1}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+69}:\\ \;\;\;\;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.15e+46)
     (/ (* -1.0 v) (+ (- u) t1))
     (if (<= t1 -1.2e-163)
       t_1
       (if (<= t1 2.6e-142)
         (/ (/ (* v t1) u) (- u))
         (if (<= t1 2.3e+69) 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.15e+46) {
		tmp = (-1.0 * v) / (-u + t1);
	} else if (t1 <= -1.2e-163) {
		tmp = t_1;
	} else if (t1 <= 2.6e-142) {
		tmp = ((v * t1) / u) / -u;
	} else if (t1 <= 2.3e+69) {
		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.15d+46)) then
        tmp = ((-1.0d0) * v) / (-u + t1)
    else if (t1 <= (-1.2d-163)) then
        tmp = t_1
    else if (t1 <= 2.6d-142) then
        tmp = ((v * t1) / u) / -u
    else if (t1 <= 2.3d+69) 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.15e+46) {
		tmp = (-1.0 * v) / (-u + t1);
	} else if (t1 <= -1.2e-163) {
		tmp = t_1;
	} else if (t1 <= 2.6e-142) {
		tmp = ((v * t1) / u) / -u;
	} else if (t1 <= 2.3e+69) {
		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.15e+46:
		tmp = (-1.0 * v) / (-u + t1)
	elif t1 <= -1.2e-163:
		tmp = t_1
	elif t1 <= 2.6e-142:
		tmp = ((v * t1) / u) / -u
	elif t1 <= 2.3e+69:
		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.15e+46)
		tmp = Float64(Float64(-1.0 * v) / Float64(Float64(-u) + t1));
	elseif (t1 <= -1.2e-163)
		tmp = t_1;
	elseif (t1 <= 2.6e-142)
		tmp = Float64(Float64(Float64(v * t1) / u) / Float64(-u));
	elseif (t1 <= 2.3e+69)
		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.15e+46)
		tmp = (-1.0 * v) / (-u + t1);
	elseif (t1 <= -1.2e-163)
		tmp = t_1;
	elseif (t1 <= 2.6e-142)
		tmp = ((v * t1) / u) / -u;
	elseif (t1 <= 2.3e+69)
		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.15e+46], N[(N[(-1.0 * v), $MachinePrecision] / N[((-u) + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.2e-163], t$95$1, If[LessEqual[t1, 2.6e-142], N[(N[(N[(v * t1), $MachinePrecision] / u), $MachinePrecision] / (-u)), $MachinePrecision], If[LessEqual[t1, 2.3e+69], 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.15 \cdot 10^{+46}:\\
\;\;\;\;\frac{-1 \cdot v}{\left(-u\right) + t1}\\

\mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-163}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{-142}:\\
\;\;\;\;\frac{\frac{v \cdot t1}{u}}{-u}\\

\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{u + t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -1.15e46

    1. Initial program 51.1%

      \[\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}{-1} \cdot \left(-v\right)}{u - t1} \]
    5. Step-by-step derivation
      1. Applied rewrites91.6%

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

      if -1.15e46 < t1 < -1.2e-163 or 2.6e-142 < t1 < 2.30000000000000017e69

      1. Initial program 90.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. mul-1-negN/A

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

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

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

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

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

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

          \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
        8. +-commutativeN/A

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

          \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
        10. lower-neg.f6492.9

          \[\leadsto \frac{v}{{\left(u + t1\right)}^{2}} \cdot \color{blue}{\left(-t1\right)} \]
      5. Applied rewrites92.9%

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

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

        if -1.2e-163 < t1 < 2.6e-142

        1. Initial program 86.0%

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

          \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{{u}^{2}}} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

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

            \[\leadsto \mathsf{neg}\left(\frac{\color{blue}{v \cdot t1}}{{u}^{2}}\right) \]
          3. unpow2N/A

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \cdot \frac{t1}{u} \]
          10. mul-1-negN/A

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

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

            \[\leadsto \frac{-v}{u} \cdot \color{blue}{\frac{t1}{u}} \]
        5. Applied rewrites85.6%

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

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

          if 2.30000000000000017e69 < t1

          1. Initial program 62.9%

            \[\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. mul-1-negN/A

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

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

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

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

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

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

              \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
            8. +-commutativeN/A

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

              \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
            10. lower-neg.f6460.5

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

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

              \[\leadsto \frac{\frac{v}{u + t1} \cdot \left(-t1\right)}{\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 rewrites92.7%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.15 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1 \cdot v}{\left(-u\right) + t1}\\ \mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-163}:\\ \;\;\;\;\frac{-v}{\left(u + t1\right) \cdot \left(u + t1\right)} \cdot t1\\ \mathbf{elif}\;t1 \leq 2.6 \cdot 10^{-142}:\\ \;\;\;\;\frac{\frac{v \cdot t1}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+69}:\\ \;\;\;\;\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: 86.7% accurate, 0.7× speedup?

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

              1. Initial program 51.1%

                \[\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}{-1} \cdot \left(-v\right)}{u - t1} \]
              5. Step-by-step derivation
                1. Applied rewrites91.6%

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

                if -1.15e46 < t1 < 1.05000000000000008e69

                1. Initial program 88.4%

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

                if 1.05000000000000008e69 < t1

                1. Initial program 62.9%

                  \[\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. mul-1-negN/A

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

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

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

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

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

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

                    \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                  8. +-commutativeN/A

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

                    \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                  10. lower-neg.f6460.5

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

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

                    \[\leadsto \frac{\frac{v}{u + t1} \cdot \left(-t1\right)}{\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 rewrites92.7%

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.15 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1 \cdot v}{\left(-u\right) + t1}\\ \mathbf{elif}\;t1 \leq 1.05 \cdot 10^{+69}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u + t1}\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 4: 86.2% accurate, 0.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.15 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1 \cdot v}{\left(-u\right) + t1}\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+69}:\\ \;\;\;\;\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.15e+46)
                     (/ (* -1.0 v) (+ (- u) t1))
                     (if (<= t1 2.3e+69)
                       (* (/ (- v) (* (+ u t1) (+ u t1))) t1)
                       (/ (- v) (+ u t1)))))
                  double code(double u, double v, double t1) {
                  	double tmp;
                  	if (t1 <= -1.15e+46) {
                  		tmp = (-1.0 * v) / (-u + t1);
                  	} else if (t1 <= 2.3e+69) {
                  		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.15d+46)) then
                          tmp = ((-1.0d0) * v) / (-u + t1)
                      else if (t1 <= 2.3d+69) 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.15e+46) {
                  		tmp = (-1.0 * v) / (-u + t1);
                  	} else if (t1 <= 2.3e+69) {
                  		tmp = (-v / ((u + t1) * (u + t1))) * t1;
                  	} else {
                  		tmp = -v / (u + t1);
                  	}
                  	return tmp;
                  }
                  
                  def code(u, v, t1):
                  	tmp = 0
                  	if t1 <= -1.15e+46:
                  		tmp = (-1.0 * v) / (-u + t1)
                  	elif t1 <= 2.3e+69:
                  		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.15e+46)
                  		tmp = Float64(Float64(-1.0 * v) / Float64(Float64(-u) + t1));
                  	elseif (t1 <= 2.3e+69)
                  		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.15e+46)
                  		tmp = (-1.0 * v) / (-u + t1);
                  	elseif (t1 <= 2.3e+69)
                  		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.15e+46], N[(N[(-1.0 * v), $MachinePrecision] / N[((-u) + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.3e+69], 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.15 \cdot 10^{+46}:\\
                  \;\;\;\;\frac{-1 \cdot v}{\left(-u\right) + t1}\\
                  
                  \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+69}:\\
                  \;\;\;\;\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.15e46

                    1. Initial program 51.1%

                      \[\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}{-1} \cdot \left(-v\right)}{u - t1} \]
                    5. Step-by-step derivation
                      1. Applied rewrites91.6%

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

                      if -1.15e46 < t1 < 2.30000000000000017e69

                      1. Initial program 88.4%

                        \[\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. mul-1-negN/A

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

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

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

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

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

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

                          \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                        8. +-commutativeN/A

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

                          \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                        10. lower-neg.f6486.1

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

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

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

                        if 2.30000000000000017e69 < t1

                        1. Initial program 62.9%

                          \[\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. mul-1-negN/A

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

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

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

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

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

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

                            \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                          8. +-commutativeN/A

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

                            \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                          10. lower-neg.f6460.5

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

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

                            \[\leadsto \frac{\frac{v}{u + t1} \cdot \left(-t1\right)}{\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 rewrites92.7%

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.15 \cdot 10^{+46}:\\ \;\;\;\;\frac{-1 \cdot v}{\left(-u\right) + t1}\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+69}:\\ \;\;\;\;\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: 77.4% accurate, 0.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.32 \cdot 10^{-70} \lor \neg \left(t1 \leq 1.12\right):\\ \;\;\;\;\frac{-v}{u + t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\ \end{array} \end{array} \]
                          (FPCore (u v t1)
                           :precision binary64
                           (if (or (<= t1 -1.32e-70) (not (<= t1 1.12)))
                             (/ (- v) (+ u t1))
                             (/ (* (- t1) v) (* u u))))
                          double code(double u, double v, double t1) {
                          	double tmp;
                          	if ((t1 <= -1.32e-70) || !(t1 <= 1.12)) {
                          		tmp = -v / (u + t1);
                          	} else {
                          		tmp = (-t1 * v) / (u * u);
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(u, v, t1)
                          use fmin_fmax_functions
                              real(8), intent (in) :: u
                              real(8), intent (in) :: v
                              real(8), intent (in) :: t1
                              real(8) :: tmp
                              if ((t1 <= (-1.32d-70)) .or. (.not. (t1 <= 1.12d0))) then
                                  tmp = -v / (u + t1)
                              else
                                  tmp = (-t1 * v) / (u * u)
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double u, double v, double t1) {
                          	double tmp;
                          	if ((t1 <= -1.32e-70) || !(t1 <= 1.12)) {
                          		tmp = -v / (u + t1);
                          	} else {
                          		tmp = (-t1 * v) / (u * u);
                          	}
                          	return tmp;
                          }
                          
                          def code(u, v, t1):
                          	tmp = 0
                          	if (t1 <= -1.32e-70) or not (t1 <= 1.12):
                          		tmp = -v / (u + t1)
                          	else:
                          		tmp = (-t1 * v) / (u * u)
                          	return tmp
                          
                          function code(u, v, t1)
                          	tmp = 0.0
                          	if ((t1 <= -1.32e-70) || !(t1 <= 1.12))
                          		tmp = Float64(Float64(-v) / Float64(u + t1));
                          	else
                          		tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(u, v, t1)
                          	tmp = 0.0;
                          	if ((t1 <= -1.32e-70) || ~((t1 <= 1.12)))
                          		tmp = -v / (u + t1);
                          	else
                          		tmp = (-t1 * v) / (u * u);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.32e-70], N[Not[LessEqual[t1, 1.12]], $MachinePrecision]], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;t1 \leq -1.32 \cdot 10^{-70} \lor \neg \left(t1 \leq 1.12\right):\\
                          \;\;\;\;\frac{-v}{u + t1}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if t1 < -1.3200000000000001e-70 or 1.1200000000000001 < t1

                            1. Initial program 65.9%

                              \[\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. mul-1-negN/A

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

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

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

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

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

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

                                \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                              8. +-commutativeN/A

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

                                \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                              10. lower-neg.f6465.9

                                \[\leadsto \frac{v}{{\left(u + t1\right)}^{2}} \cdot \color{blue}{\left(-t1\right)} \]
                            5. Applied rewrites65.9%

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

                                \[\leadsto \frac{\frac{v}{u + t1} \cdot \left(-t1\right)}{\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 rewrites87.2%

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

                                if -1.3200000000000001e-70 < t1 < 1.1200000000000001

                                1. Initial program 88.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 \frac{\left(-t1\right) \cdot v}{\color{blue}{{u}^{2}}} \]
                                4. Step-by-step derivation
                                  1. unpow2N/A

                                    \[\leadsto \frac{\left(-t1\right) \cdot v}{\color{blue}{u \cdot u}} \]
                                  2. lower-*.f6479.6

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

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

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

                              Alternative 6: 77.1% accurate, 0.8× speedup?

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

                                1. Initial program 65.9%

                                  \[\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. mul-1-negN/A

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

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

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

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

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

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

                                    \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                  8. +-commutativeN/A

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

                                    \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                  10. lower-neg.f6465.9

                                    \[\leadsto \frac{v}{{\left(u + t1\right)}^{2}} \cdot \color{blue}{\left(-t1\right)} \]
                                5. Applied rewrites65.9%

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

                                    \[\leadsto \frac{\frac{v}{u + t1} \cdot \left(-t1\right)}{\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 rewrites87.2%

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

                                    if -9.39999999999999993e-71 < t1 < 1.1200000000000001

                                    1. Initial program 88.0%

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

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

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

                                        \[\leadsto \left(-v\right) \cdot \frac{t1}{\color{blue}{u \cdot u}} \]
                                      2. lower-*.f6476.1

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

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

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

                                  Alternative 7: 77.0% accurate, 0.8× speedup?

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

                                    1. Initial program 65.9%

                                      \[\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. mul-1-negN/A

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

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

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

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

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

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

                                        \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                      8. +-commutativeN/A

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

                                        \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                      10. lower-neg.f6465.9

                                        \[\leadsto \frac{v}{{\left(u + t1\right)}^{2}} \cdot \color{blue}{\left(-t1\right)} \]
                                    5. Applied rewrites65.9%

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

                                        \[\leadsto \frac{\frac{v}{u + t1} \cdot \left(-t1\right)}{\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 rewrites87.2%

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

                                        if -1.3200000000000001e-70 < t1 < 1.1200000000000001

                                        1. Initial program 88.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. div-addN/A

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

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

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \color{blue}{\frac{2 \cdot \left({t1}^{2} \cdot v\right)}{u \cdot {u}^{2}}} \]
                                          4. count-2-revN/A

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \frac{\color{blue}{{t1}^{2} \cdot v + {t1}^{2} \cdot v}}{u \cdot {u}^{2}} \]
                                          5. unpow2N/A

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

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \frac{\color{blue}{t1 \cdot \left(t1 \cdot v\right)} + {t1}^{2} \cdot v}{u \cdot {u}^{2}} \]
                                          7. unpow2N/A

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

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \frac{t1 \cdot \left(t1 \cdot v\right) + \color{blue}{t1 \cdot \left(t1 \cdot v\right)}}{u \cdot {u}^{2}} \]
                                          9. distribute-lft-inN/A

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \frac{\color{blue}{t1 \cdot \left(t1 \cdot v + t1 \cdot v\right)}}{u \cdot {u}^{2}} \]
                                          10. count-2-revN/A

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \frac{t1 \cdot \color{blue}{\left(2 \cdot \left(t1 \cdot v\right)\right)}}{u \cdot {u}^{2}} \]
                                          11. unpow2N/A

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \frac{t1 \cdot \left(2 \cdot \left(t1 \cdot v\right)\right)}{u \cdot \color{blue}{\left(u \cdot u\right)}} \]
                                          12. cube-multN/A

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \frac{t1 \cdot \left(2 \cdot \left(t1 \cdot v\right)\right)}{\color{blue}{{u}^{3}}} \]
                                          13. associate-*r/N/A

                                            \[\leadsto \frac{-1 \cdot \left(t1 \cdot v\right)}{{u}^{2}} + \color{blue}{t1 \cdot \frac{2 \cdot \left(t1 \cdot v\right)}{{u}^{3}}} \]
                                          14. associate-*r/N/A

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

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

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

                                            \[\leadsto \frac{-v}{u \cdot u} \cdot t1 \]
                                        8. Recombined 2 regimes into one program.
                                        9. Final simplification81.4%

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

                                        Alternative 8: 98.1% accurate, 0.8× speedup?

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

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

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

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

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

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

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

                                            \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                          8. +-commutativeN/A

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

                                            \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                          10. lower-neg.f6472.9

                                            \[\leadsto \frac{v}{{\left(u + t1\right)}^{2}} \cdot \color{blue}{\left(-t1\right)} \]
                                        5. Applied rewrites72.9%

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

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

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

                                          Alternative 9: 61.9% accurate, 1.8× 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(Float64(-v) / Float64(u + t1))
                                          end
                                          
                                          function tmp = code(u, v, t1)
                                          	tmp = -v / (u + t1);
                                          end
                                          
                                          code[u_, v_, t1_] := N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \frac{-v}{u + t1}
                                          \end{array}
                                          
                                          Derivation
                                          1. Initial program 75.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. mul-1-negN/A

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

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

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

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

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

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

                                              \[\leadsto \frac{v}{\color{blue}{{\left(t1 + u\right)}^{2}}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                            8. +-commutativeN/A

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

                                              \[\leadsto \frac{v}{{\color{blue}{\left(u + t1\right)}}^{2}} \cdot \left(\mathsf{neg}\left(t1\right)\right) \]
                                            10. lower-neg.f6472.9

                                              \[\leadsto \frac{v}{{\left(u + t1\right)}^{2}} \cdot \color{blue}{\left(-t1\right)} \]
                                          5. Applied rewrites72.9%

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

                                              \[\leadsto \frac{\frac{v}{u + t1} \cdot \left(-t1\right)}{\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 rewrites64.0%

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

                                              Alternative 10: 54.4% accurate, 2.1× speedup?

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

                                                \[\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. associate-*r/N/A

                                                  \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
                                                2. lower-/.f64N/A

                                                  \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
                                                3. mul-1-negN/A

                                                  \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1} \]
                                                4. lower-neg.f6458.0

                                                  \[\leadsto \frac{\color{blue}{-v}}{t1} \]
                                              5. Applied rewrites58.0%

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

                                              Reproduce

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