Rosa's DopplerBench

Percentage Accurate: 73.5% → 98.1%
Time: 4.5s
Alternatives: 11
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 11 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.5% 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: 98.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{\frac{t1}{u + t1} \cdot \left(-v\right)}{u + 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)) * Float64(-v)) / 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 \left(-v\right)}{u + t1}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-t1}}{t1 + u} \cdot \frac{v}{t1 + u} \]
    11. +-commutativeN/A

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

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

      \[\leadsto \frac{-t1}{u + t1} \cdot \color{blue}{\frac{v}{t1 + u}} \]
    14. +-commutativeN/A

      \[\leadsto \frac{-t1}{u + t1} \cdot \frac{v}{\color{blue}{u + t1}} \]
    15. lower-+.f6498.4

      \[\leadsto \frac{-t1}{u + t1} \cdot \frac{v}{\color{blue}{u + t1}} \]
  4. Applied rewrites98.4%

    \[\leadsto \color{blue}{\frac{-t1}{u + t1} \cdot \frac{v}{u + t1}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{-t1}}{u + t1} \cdot v}{u + t1} \]
    12. lift-+.f64N/A

      \[\leadsto \frac{\frac{-t1}{\color{blue}{u + t1}} \cdot v}{u + t1} \]
    13. lift-+.f6498.7

      \[\leadsto \frac{\frac{-t1}{u + t1} \cdot v}{\color{blue}{u + t1}} \]
  6. Applied rewrites98.7%

    \[\leadsto \color{blue}{\frac{\frac{-t1}{u + t1} \cdot v}{u + t1}} \]
  7. Final simplification98.7%

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

Alternative 2: 87.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t1 \cdot \frac{-v}{\mathsf{fma}\left(\mathsf{fma}\left(2, u, t1\right), t1, u \cdot u\right)}\\ \mathbf{if}\;t1 \leq -3.75 \cdot 10^{+124}:\\ \;\;\;\;\frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1}\\ \mathbf{elif}\;t1 \leq -3.2 \cdot 10^{-98}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 3.7 \cdot 10^{-176}:\\ \;\;\;\;\frac{v \cdot \frac{-t1}{u}}{u}\\ \mathbf{elif}\;t1 \leq 1.55 \cdot 10^{+110}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* t1 (/ (- v) (fma (fma 2.0 u t1) t1 (* u u))))))
   (if (<= t1 -3.75e+124)
     (/ (fma u (/ v t1) (- v)) (+ u t1))
     (if (<= t1 -3.2e-98)
       t_1
       (if (<= t1 3.7e-176)
         (/ (* v (/ (- t1) u)) u)
         (if (<= t1 1.55e+110) t_1 (/ (- v) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = t1 * (-v / fma(fma(2.0, u, t1), t1, (u * u)));
	double tmp;
	if (t1 <= -3.75e+124) {
		tmp = fma(u, (v / t1), -v) / (u + t1);
	} else if (t1 <= -3.2e-98) {
		tmp = t_1;
	} else if (t1 <= 3.7e-176) {
		tmp = (v * (-t1 / u)) / u;
	} else if (t1 <= 1.55e+110) {
		tmp = t_1;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
function code(u, v, t1)
	t_1 = Float64(t1 * Float64(Float64(-v) / fma(fma(2.0, u, t1), t1, Float64(u * u))))
	tmp = 0.0
	if (t1 <= -3.75e+124)
		tmp = Float64(fma(u, Float64(v / t1), Float64(-v)) / Float64(u + t1));
	elseif (t1 <= -3.2e-98)
		tmp = t_1;
	elseif (t1 <= 3.7e-176)
		tmp = Float64(Float64(v * Float64(Float64(-t1) / u)) / u);
	elseif (t1 <= 1.55e+110)
		tmp = t_1;
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 * N[((-v) / N[(N[(2.0 * u + t1), $MachinePrecision] * t1 + N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.75e+124], N[(N[(u * N[(v / t1), $MachinePrecision] + (-v)), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -3.2e-98], t$95$1, If[LessEqual[t1, 3.7e-176], N[(N[(v * N[((-t1) / u), $MachinePrecision]), $MachinePrecision] / u), $MachinePrecision], If[LessEqual[t1, 1.55e+110], t$95$1, N[((-v) / t1), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t1 \cdot \frac{-v}{\mathsf{fma}\left(\mathsf{fma}\left(2, u, t1\right), t1, u \cdot u\right)}\\
\mathbf{if}\;t1 \leq -3.75 \cdot 10^{+124}:\\
\;\;\;\;\frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1}\\

\mathbf{elif}\;t1 \leq -3.2 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t1 \leq 1.55 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 45.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
      19. lower-+.f6468.9

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v + \frac{u \cdot v}{t1}}}{u + t1} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(u, \frac{v}{t1}, \mathsf{neg}\left(v\right)\right)}{u + t1} \]
      6. lift-neg.f6496.8

        \[\leadsto \frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1} \]
    7. Applied rewrites96.8%

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

    if -3.75000000000000019e124 < t1 < -3.2000000000000001e-98 or 3.69999999999999984e-176 < t1 < 1.55000000000000009e110

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-t1\right) \cdot \frac{v}{\left(u + t1\right) \cdot t1} \]
      3. Applied rewrites63.9%

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

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

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

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

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

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

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

          \[\leadsto \left(-t1\right) \cdot \frac{v}{\mathsf{fma}\left(\mathsf{fma}\left(2, u, t1\right), t1, {u}^{2}\right)} \]
        7. unpow2N/A

          \[\leadsto \left(-t1\right) \cdot \frac{v}{\mathsf{fma}\left(\mathsf{fma}\left(2, u, t1\right), t1, u \cdot u\right)} \]
        8. lower-*.f6491.4

          \[\leadsto \left(-t1\right) \cdot \frac{v}{\mathsf{fma}\left(\mathsf{fma}\left(2, u, t1\right), t1, u \cdot u\right)} \]
      6. Applied rewrites91.4%

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

      if -3.2000000000000001e-98 < t1 < 3.69999999999999984e-176

      1. Initial program 81.9%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{-1 \cdot t1}{u} \]
        8. associate-*r/N/A

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{\mathsf{neg}\left(t1\right)}{\color{blue}{u}} \]
        14. lift-neg.f6489.8

          \[\leadsto \frac{v}{u} \cdot \frac{-t1}{u} \]
      5. Applied rewrites89.8%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{v \cdot \frac{\mathsf{neg}\left(t1\right)}{u}}{u} \]
        13. lift-neg.f6491.0

          \[\leadsto \frac{v \cdot \frac{-t1}{u}}{u} \]
      7. Applied rewrites91.0%

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

      if 1.55000000000000009e110 < t1

      1. Initial program 48.9%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
      4. Step-by-step derivation
        1. associate-*r/N/A

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

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

          \[\leadsto \frac{\mathsf{neg}\left(v\right)}{t1} \]
        4. lower-neg.f6490.8

          \[\leadsto \frac{-v}{t1} \]
      5. Applied rewrites90.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.75 \cdot 10^{+124}:\\ \;\;\;\;\frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1}\\ \mathbf{elif}\;t1 \leq -3.2 \cdot 10^{-98}:\\ \;\;\;\;t1 \cdot \frac{-v}{\mathsf{fma}\left(\mathsf{fma}\left(2, u, t1\right), t1, u \cdot u\right)}\\ \mathbf{elif}\;t1 \leq 3.7 \cdot 10^{-176}:\\ \;\;\;\;\frac{v \cdot \frac{-t1}{u}}{u}\\ \mathbf{elif}\;t1 \leq 1.55 \cdot 10^{+110}:\\ \;\;\;\;t1 \cdot \frac{-v}{\mathsf{fma}\left(\mathsf{fma}\left(2, u, t1\right), t1, u \cdot u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 86.2% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.3 \cdot 10^{+129} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+85}\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \end{array} \end{array} \]
    (FPCore (u v t1)
     :precision binary64
     (if (or (<= t1 -2.3e+129) (not (<= t1 3.6e+85)))
       (/ (fma u (/ v t1) (- v)) (+ u t1))
       (/ (* (- t1) v) (* (+ t1 u) (+ t1 u)))))
    double code(double u, double v, double t1) {
    	double tmp;
    	if ((t1 <= -2.3e+129) || !(t1 <= 3.6e+85)) {
    		tmp = fma(u, (v / t1), -v) / (u + t1);
    	} else {
    		tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
    	}
    	return tmp;
    }
    
    function code(u, v, t1)
    	tmp = 0.0
    	if ((t1 <= -2.3e+129) || !(t1 <= 3.6e+85))
    		tmp = Float64(fma(u, Float64(v / t1), Float64(-v)) / Float64(u + t1));
    	else
    		tmp = Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)));
    	end
    	return tmp
    end
    
    code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.3e+129], N[Not[LessEqual[t1, 3.6e+85]], $MachinePrecision]], N[(N[(u * N[(v / t1), $MachinePrecision] + (-v)), $MachinePrecision] / N[(u + t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t1 \leq -2.3 \cdot 10^{+129} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+85}\right):\\
    \;\;\;\;\frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t1 < -2.2999999999999999e129 or 3.5999999999999998e85 < t1

      1. Initial program 47.7%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
        19. lower-+.f6466.6

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot v + \frac{u \cdot v}{t1}}}{u + t1} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(u, \frac{v}{t1}, \mathsf{neg}\left(v\right)\right)}{u + t1} \]
        6. lift-neg.f6492.9

          \[\leadsto \frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1} \]
      7. Applied rewrites92.9%

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

      if -2.2999999999999999e129 < t1 < 3.5999999999999998e85

      1. Initial program 85.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.3 \cdot 10^{+129} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+85}\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(u, \frac{v}{t1}, -v\right)}{u + t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 86.4% accurate, 0.7× speedup?

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

      1. Initial program 54.3%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
        19. lower-+.f6471.2

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

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

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

          \[\leadsto \frac{\mathsf{neg}\left(v\right)}{u + t1} \]
        2. lift-neg.f6491.5

          \[\leadsto \frac{-v}{u + t1} \]
      7. Applied rewrites91.5%

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

      if -8.1999999999999994e119 < t1 < 1.44999999999999994e41

      1. Initial program 85.5%

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

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

    Alternative 5: 79.8% accurate, 0.7× speedup?

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

      1. Initial program 70.1%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
        19. lower-+.f6481.7

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
      4. Applied rewrites81.7%

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

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

          \[\leadsto \frac{\mathsf{neg}\left(v\right)}{u + t1} \]
        2. lift-neg.f6481.4

          \[\leadsto \frac{-v}{u + t1} \]
      7. Applied rewrites81.4%

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

      if -2.20000000000000019e-47 < t1 < 9.00000000000000032e-107

      1. Initial program 84.8%

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

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

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{-1 \cdot t1}{u} \]
        8. associate-*r/N/A

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{\mathsf{neg}\left(t1\right)}{\color{blue}{u}} \]
        14. lift-neg.f6483.1

          \[\leadsto \frac{v}{u} \cdot \frac{-t1}{u} \]
      5. Applied rewrites83.1%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{v \cdot \frac{\mathsf{neg}\left(t1\right)}{u}}{u} \]
        13. lift-neg.f6484.0

          \[\leadsto \frac{v \cdot \frac{-t1}{u}}{u} \]
      7. Applied rewrites84.0%

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

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

    Alternative 6: 79.5% accurate, 0.7× speedup?

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

      1. Initial program 70.1%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
        19. lower-+.f6481.7

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
      4. Applied rewrites81.7%

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

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

          \[\leadsto \frac{\mathsf{neg}\left(v\right)}{u + t1} \]
        2. lift-neg.f6481.4

          \[\leadsto \frac{-v}{u + t1} \]
      7. Applied rewrites81.4%

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

      if -2.20000000000000019e-47 < t1 < 9.00000000000000032e-107

      1. Initial program 84.8%

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

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

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{-1 \cdot t1}{u} \]
        8. associate-*r/N/A

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{\mathsf{neg}\left(t1\right)}{\color{blue}{u}} \]
        14. lift-neg.f6483.1

          \[\leadsto \frac{v}{u} \cdot \frac{-t1}{u} \]
      5. Applied rewrites83.1%

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

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

    Alternative 7: 77.4% accurate, 0.8× speedup?

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

      1. Initial program 70.1%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
        19. lower-+.f6481.7

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
      4. Applied rewrites81.7%

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

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

          \[\leadsto \frac{\mathsf{neg}\left(v\right)}{u + t1} \]
        2. lift-neg.f6481.4

          \[\leadsto \frac{-v}{u + t1} \]
      7. Applied rewrites81.4%

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

      if -2.20000000000000019e-47 < t1 < 9.00000000000000032e-107

      1. Initial program 84.8%

        \[\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}{u \cdot \color{blue}{u}} \]
        2. lower-*.f6476.7

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

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

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

    Alternative 8: 77.0% accurate, 0.8× speedup?

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

      1. Initial program 70.1%

        \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
        19. lower-+.f6481.7

          \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
      4. Applied rewrites81.7%

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

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

          \[\leadsto \frac{\mathsf{neg}\left(v\right)}{u + t1} \]
        2. lift-neg.f6481.4

          \[\leadsto \frac{-v}{u + t1} \]
      7. Applied rewrites81.4%

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

      if -9.2000000000000003e-48 < t1 < 9.00000000000000032e-107

      1. Initial program 84.8%

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

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

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{-1 \cdot t1}{u} \]
        8. associate-*r/N/A

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

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

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

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

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

          \[\leadsto \frac{v}{u} \cdot \frac{\mathsf{neg}\left(t1\right)}{\color{blue}{u}} \]
        14. lift-neg.f6483.1

          \[\leadsto \frac{v}{u} \cdot \frac{-t1}{u} \]
      5. Applied rewrites83.1%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -\frac{t1 \cdot v}{{u}^{2}} \]
        13. associate-/l*N/A

          \[\leadsto -t1 \cdot \frac{v}{{u}^{2}} \]
        14. lower-*.f64N/A

          \[\leadsto -t1 \cdot \frac{v}{{u}^{2}} \]
        15. lower-/.f64N/A

          \[\leadsto -t1 \cdot \frac{v}{{u}^{2}} \]
        16. unpow2N/A

          \[\leadsto -t1 \cdot \frac{v}{u \cdot u} \]
        17. lower-*.f6475.6

          \[\leadsto -t1 \cdot \frac{v}{u \cdot u} \]
      7. Applied rewrites75.6%

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

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

    Alternative 9: 97.8% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \frac{-t1}{u + t1} \cdot \frac{v}{u + 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)) * Float64(v / Float64(u + t1)))
    end
    
    function tmp = code(u, v, t1)
    	tmp = (-t1 / (u + t1)) * (v / (u + t1));
    end
    
    code[u_, v_, t1_] := N[(N[((-t1) / N[(u + t1), $MachinePrecision]), $MachinePrecision] * N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{-t1}{u + t1} \cdot \frac{v}{u + t1}
    \end{array}
    
    Derivation
    1. Initial program 75.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1}}{t1 + u} \cdot \frac{v}{t1 + u} \]
      11. +-commutativeN/A

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

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

        \[\leadsto \frac{-t1}{u + t1} \cdot \color{blue}{\frac{v}{t1 + u}} \]
      14. +-commutativeN/A

        \[\leadsto \frac{-t1}{u + t1} \cdot \frac{v}{\color{blue}{u + t1}} \]
      15. lower-+.f6498.4

        \[\leadsto \frac{-t1}{u + t1} \cdot \frac{v}{\color{blue}{u + t1}} \]
    4. Applied rewrites98.4%

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

    Alternative 10: 61.8% 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.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(-t1\right) \cdot v}{u + t1}}{\color{blue}{u + t1}} \]
      19. lower-+.f6483.4

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(v\right)}{u + t1} \]
      2. lift-neg.f6462.7

        \[\leadsto \frac{-v}{u + t1} \]
    7. Applied rewrites62.7%

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

    Alternative 11: 53.6% 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.7%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \frac{\mathsf{neg}\left(v\right)}{t1} \]
      4. lower-neg.f6455.4

        \[\leadsto \frac{-v}{t1} \]
    5. Applied rewrites55.4%

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

    Reproduce

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