Rosa's DopplerBench

Percentage Accurate: 72.4% → 98.2%
Time: 11.2s
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));
}
real(8) function code(u, v, t1)
    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: 72.4% 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));
}
real(8) function code(u, v, t1)
    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.2% accurate, 0.8× speedup?

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

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

    \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    2. 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)} \]
    3. 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)}} \]
    4. times-fracN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(\mathsf{neg}\left(\frac{t1}{t1 + u}\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(v\right)\right)}}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
    14. lower-neg.f6497.6

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t1 + u\right) \cdot \left(t1 + u\right)\\ t_2 := -\frac{v}{t1}\\ \mathbf{if}\;t1 \leq -5 \cdot 10^{+154}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t1 \leq -5.3 \cdot 10^{-182}:\\ \;\;\;\;v \cdot \frac{-t1}{t\_1}\\ \mathbf{elif}\;t1 \leq 1.7 \cdot 10^{-246}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{-u}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 1.95 \cdot 10^{+149}:\\ \;\;\;\;t1 \cdot \left(v \cdot \frac{-1}{t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* (+ t1 u) (+ t1 u))) (t_2 (- (/ v t1))))
   (if (<= t1 -5e+154)
     t_2
     (if (<= t1 -5.3e-182)
       (* v (/ (- t1) t_1))
       (if (<= t1 1.7e-246)
         (* v (/ (/ t1 (- u)) (+ t1 u)))
         (if (<= t1 1.95e+149) (* t1 (* v (/ -1.0 t_1))) t_2))))))
double code(double u, double v, double t1) {
	double t_1 = (t1 + u) * (t1 + u);
	double t_2 = -(v / t1);
	double tmp;
	if (t1 <= -5e+154) {
		tmp = t_2;
	} else if (t1 <= -5.3e-182) {
		tmp = v * (-t1 / t_1);
	} else if (t1 <= 1.7e-246) {
		tmp = v * ((t1 / -u) / (t1 + u));
	} else if (t1 <= 1.95e+149) {
		tmp = t1 * (v * (-1.0 / t_1));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (t1 + u) * (t1 + u)
    t_2 = -(v / t1)
    if (t1 <= (-5d+154)) then
        tmp = t_2
    else if (t1 <= (-5.3d-182)) then
        tmp = v * (-t1 / t_1)
    else if (t1 <= 1.7d-246) then
        tmp = v * ((t1 / -u) / (t1 + u))
    else if (t1 <= 1.95d+149) then
        tmp = t1 * (v * ((-1.0d0) / t_1))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = (t1 + u) * (t1 + u);
	double t_2 = -(v / t1);
	double tmp;
	if (t1 <= -5e+154) {
		tmp = t_2;
	} else if (t1 <= -5.3e-182) {
		tmp = v * (-t1 / t_1);
	} else if (t1 <= 1.7e-246) {
		tmp = v * ((t1 / -u) / (t1 + u));
	} else if (t1 <= 1.95e+149) {
		tmp = t1 * (v * (-1.0 / t_1));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (t1 + u) * (t1 + u)
	t_2 = -(v / t1)
	tmp = 0
	if t1 <= -5e+154:
		tmp = t_2
	elif t1 <= -5.3e-182:
		tmp = v * (-t1 / t_1)
	elif t1 <= 1.7e-246:
		tmp = v * ((t1 / -u) / (t1 + u))
	elif t1 <= 1.95e+149:
		tmp = t1 * (v * (-1.0 / t_1))
	else:
		tmp = t_2
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(t1 + u) * Float64(t1 + u))
	t_2 = Float64(-Float64(v / t1))
	tmp = 0.0
	if (t1 <= -5e+154)
		tmp = t_2;
	elseif (t1 <= -5.3e-182)
		tmp = Float64(v * Float64(Float64(-t1) / t_1));
	elseif (t1 <= 1.7e-246)
		tmp = Float64(v * Float64(Float64(t1 / Float64(-u)) / Float64(t1 + u)));
	elseif (t1 <= 1.95e+149)
		tmp = Float64(t1 * Float64(v * Float64(-1.0 / t_1)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (t1 + u) * (t1 + u);
	t_2 = -(v / t1);
	tmp = 0.0;
	if (t1 <= -5e+154)
		tmp = t_2;
	elseif (t1 <= -5.3e-182)
		tmp = v * (-t1 / t_1);
	elseif (t1 <= 1.7e-246)
		tmp = v * ((t1 / -u) / (t1 + u));
	elseif (t1 <= 1.95e+149)
		tmp = t1 * (v * (-1.0 / t_1));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[(v / t1), $MachinePrecision])}, If[LessEqual[t1, -5e+154], t$95$2, If[LessEqual[t1, -5.3e-182], N[(v * N[((-t1) / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.7e-246], N[(v * N[(N[(t1 / (-u)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.95e+149], N[(t1 * N[(v * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t1 \leq -5.3 \cdot 10^{-182}:\\
\;\;\;\;v \cdot \frac{-t1}{t\_1}\\

\mathbf{elif}\;t1 \leq 1.7 \cdot 10^{-246}:\\
\;\;\;\;v \cdot \frac{\frac{t1}{-u}}{t1 + u}\\

\mathbf{elif}\;t1 \leq 1.95 \cdot 10^{+149}:\\
\;\;\;\;t1 \cdot \left(v \cdot \frac{-1}{t\_1}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -5.00000000000000004e154 or 1.95e149 < t1

    1. Initial program 30.4%

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

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

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

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

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

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

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

    if -5.00000000000000004e154 < t1 < -5.30000000000000005e-182

    1. Initial program 82.0%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. *-commutativeN/A

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

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

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

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

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

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

    if -5.30000000000000005e-182 < t1 < 1.7000000000000001e-246

    1. Initial program 72.6%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{t1}{\color{blue}{-u}}}{t1 + u} \cdot v \]
    9. Applied rewrites91.0%

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

    if 1.7000000000000001e-246 < t1 < 1.95e149

    1. Initial program 87.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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t1 \cdot \left(v \cdot \color{blue}{\frac{\frac{1}{-1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)}}\right) \]
      13. metadata-evalN/A

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5 \cdot 10^{+154}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{elif}\;t1 \leq -5.3 \cdot 10^{-182}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 1.7 \cdot 10^{-246}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{-u}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 1.95 \cdot 10^{+149}:\\ \;\;\;\;t1 \cdot \left(v \cdot \frac{-1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 89.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\frac{v}{t1}\\ t_2 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{if}\;t1 \leq -5 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq -2.4 \cdot 10^{-231}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t1 \leq 2.1 \cdot 10^{-125}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 5.7 \cdot 10^{+149}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (- (/ v t1))) (t_2 (* v (/ (- t1) (* (+ t1 u) (+ t1 u))))))
   (if (<= t1 -5e+154)
     t_1
     (if (<= t1 -2.4e-231)
       t_2
       (if (<= t1 2.1e-125)
         (/ (* t1 (/ v u)) (- u))
         (if (<= t1 5.7e+149) t_2 t_1))))))
double code(double u, double v, double t1) {
	double t_1 = -(v / t1);
	double t_2 = v * (-t1 / ((t1 + u) * (t1 + u)));
	double tmp;
	if (t1 <= -5e+154) {
		tmp = t_1;
	} else if (t1 <= -2.4e-231) {
		tmp = t_2;
	} else if (t1 <= 2.1e-125) {
		tmp = (t1 * (v / u)) / -u;
	} else if (t1 <= 5.7e+149) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = -(v / t1)
    t_2 = v * (-t1 / ((t1 + u) * (t1 + u)))
    if (t1 <= (-5d+154)) then
        tmp = t_1
    else if (t1 <= (-2.4d-231)) then
        tmp = t_2
    else if (t1 <= 2.1d-125) then
        tmp = (t1 * (v / u)) / -u
    else if (t1 <= 5.7d+149) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -(v / t1);
	double t_2 = v * (-t1 / ((t1 + u) * (t1 + u)));
	double tmp;
	if (t1 <= -5e+154) {
		tmp = t_1;
	} else if (t1 <= -2.4e-231) {
		tmp = t_2;
	} else if (t1 <= 2.1e-125) {
		tmp = (t1 * (v / u)) / -u;
	} else if (t1 <= 5.7e+149) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -(v / t1)
	t_2 = v * (-t1 / ((t1 + u) * (t1 + u)))
	tmp = 0
	if t1 <= -5e+154:
		tmp = t_1
	elif t1 <= -2.4e-231:
		tmp = t_2
	elif t1 <= 2.1e-125:
		tmp = (t1 * (v / u)) / -u
	elif t1 <= 5.7e+149:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(u, v, t1)
	t_1 = Float64(-Float64(v / t1))
	t_2 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u))))
	tmp = 0.0
	if (t1 <= -5e+154)
		tmp = t_1;
	elseif (t1 <= -2.4e-231)
		tmp = t_2;
	elseif (t1 <= 2.1e-125)
		tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u));
	elseif (t1 <= 5.7e+149)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -(v / t1);
	t_2 = v * (-t1 / ((t1 + u) * (t1 + u)));
	tmp = 0.0;
	if (t1 <= -5e+154)
		tmp = t_1;
	elseif (t1 <= -2.4e-231)
		tmp = t_2;
	elseif (t1 <= 2.1e-125)
		tmp = (t1 * (v / u)) / -u;
	elseif (t1 <= 5.7e+149)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = (-N[(v / t1), $MachinePrecision])}, Block[{t$95$2 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -5e+154], t$95$1, If[LessEqual[t1, -2.4e-231], t$95$2, If[LessEqual[t1, 2.1e-125], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[LessEqual[t1, 5.7e+149], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t1 \leq -2.4 \cdot 10^{-231}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t1 \leq 5.7 \cdot 10^{+149}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -5.00000000000000004e154 or 5.69999999999999965e149 < t1

    1. Initial program 30.4%

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

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

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

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

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

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

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

    if -5.00000000000000004e154 < t1 < -2.39999999999999992e-231 or 2.1e-125 < t1 < 5.69999999999999965e149

    1. Initial program 85.8%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. *-commutativeN/A

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

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

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

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

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

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

    if -2.39999999999999992e-231 < t1 < 2.1e-125

    1. Initial program 72.9%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. 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)}} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(\frac{t1}{t1 + u}\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(v\right)\right)}}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      14. lower-neg.f6488.4

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5 \cdot 10^{+154}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{elif}\;t1 \leq -2.4 \cdot 10^{-231}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 2.1 \cdot 10^{-125}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{elif}\;t1 \leq 5.7 \cdot 10^{+149}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -2 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 4.8 \cdot 10^{-247}:\\ \;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\ \mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-6}:\\ \;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))))
   (if (<= t1 -2e+67)
     t_1
     (if (<= t1 4.8e-247)
       (* v (/ (- t1) (* u u)))
       (if (<= t1 9.5e-6) (* (- t1) (/ v (* u u))) t_1)))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2e+67) {
		tmp = t_1;
	} else if (t1 <= 4.8e-247) {
		tmp = v * (-t1 / (u * u));
	} else if (t1 <= 9.5e-6) {
		tmp = -t1 * (v / (u * u));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / (t1 + u)
    if (t1 <= (-2d+67)) then
        tmp = t_1
    else if (t1 <= 4.8d-247) then
        tmp = v * (-t1 / (u * u))
    else if (t1 <= 9.5d-6) then
        tmp = -t1 * (v / (u * u))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2e+67) {
		tmp = t_1;
	} else if (t1 <= 4.8e-247) {
		tmp = v * (-t1 / (u * u));
	} else if (t1 <= 9.5e-6) {
		tmp = -t1 * (v / (u * u));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	tmp = 0
	if t1 <= -2e+67:
		tmp = t_1
	elif t1 <= 4.8e-247:
		tmp = v * (-t1 / (u * u))
	elif t1 <= 9.5e-6:
		tmp = -t1 * (v / (u * u))
	else:
		tmp = t_1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -2e+67)
		tmp = t_1;
	elseif (t1 <= 4.8e-247)
		tmp = Float64(v * Float64(Float64(-t1) / Float64(u * u)));
	elseif (t1 <= 9.5e-6)
		tmp = Float64(Float64(-t1) * Float64(v / Float64(u * u)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -2e+67)
		tmp = t_1;
	elseif (t1 <= 4.8e-247)
		tmp = v * (-t1 / (u * u));
	elseif (t1 <= 9.5e-6)
		tmp = -t1 * (v / (u * u));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2e+67], t$95$1, If[LessEqual[t1, 4.8e-247], N[(v * N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 9.5e-6], N[((-t1) * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -2 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-6}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.99999999999999997e67 or 9.5000000000000005e-6 < t1

    1. Initial program 53.0%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. 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)}} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1 \cdot \frac{v}{u}}}{t1 + u} \]
    9. Applied rewrites18.0%

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    12. Applied rewrites88.6%

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

    if -1.99999999999999997e67 < t1 < 4.80000000000000022e-247

    1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.80000000000000022e-247 < t1 < 9.5000000000000005e-6

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t1 \cdot \frac{v}{\color{blue}{u \cdot \left(\mathsf{neg}\left(u\right)\right)}} \]
      14. lower-neg.f6473.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2 \cdot 10^{+67}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 4.8 \cdot 10^{-247}:\\ \;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\ \mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-6}:\\ \;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 88.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -\frac{v}{t1}\\ \mathbf{if}\;t1 \leq -5 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 5.7 \cdot 10^{+149}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (- (/ v t1))))
   (if (<= t1 -5e+154)
     t_1
     (if (<= t1 5.7e+149) (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))) t_1))))
double code(double u, double v, double t1) {
	double t_1 = -(v / t1);
	double tmp;
	if (t1 <= -5e+154) {
		tmp = t_1;
	} else if (t1 <= 5.7e+149) {
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -(v / t1)
    if (t1 <= (-5d+154)) then
        tmp = t_1
    else if (t1 <= 5.7d+149) then
        tmp = v * (-t1 / ((t1 + u) * (t1 + u)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -(v / t1);
	double tmp;
	if (t1 <= -5e+154) {
		tmp = t_1;
	} else if (t1 <= 5.7e+149) {
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -(v / t1)
	tmp = 0
	if t1 <= -5e+154:
		tmp = t_1
	elif t1 <= 5.7e+149:
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)))
	else:
		tmp = t_1
	return tmp
function code(u, v, t1)
	t_1 = Float64(-Float64(v / t1))
	tmp = 0.0
	if (t1 <= -5e+154)
		tmp = t_1;
	elseif (t1 <= 5.7e+149)
		tmp = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -(v / t1);
	tmp = 0.0;
	if (t1 <= -5e+154)
		tmp = t_1;
	elseif (t1 <= 5.7e+149)
		tmp = v * (-t1 / ((t1 + u) * (t1 + u)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = (-N[(v / t1), $MachinePrecision])}, If[LessEqual[t1, -5e+154], t$95$1, If[LessEqual[t1, 5.7e+149], N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -\frac{v}{t1}\\
\mathbf{if}\;t1 \leq -5 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 5.7 \cdot 10^{+149}:\\
\;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -5.00000000000000004e154 or 5.69999999999999965e149 < t1

    1. Initial program 30.4%

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

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

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

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

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

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

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

    if -5.00000000000000004e154 < t1 < 5.69999999999999965e149

    1. Initial program 82.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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. *-commutativeN/A

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5 \cdot 10^{+154}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{elif}\;t1 \leq 5.7 \cdot 10^{+149}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -2 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{t1 \cdot \left(-v\right)}{u \cdot u}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))))
   (if (<= t1 -2e+67) t_1 (if (<= t1 9.5e-6) (/ (* t1 (- v)) (* u u)) t_1))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2e+67) {
		tmp = t_1;
	} else if (t1 <= 9.5e-6) {
		tmp = (t1 * -v) / (u * u);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / (t1 + u)
    if (t1 <= (-2d+67)) then
        tmp = t_1
    else if (t1 <= 9.5d-6) then
        tmp = (t1 * -v) / (u * u)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2e+67) {
		tmp = t_1;
	} else if (t1 <= 9.5e-6) {
		tmp = (t1 * -v) / (u * u);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	tmp = 0
	if t1 <= -2e+67:
		tmp = t_1
	elif t1 <= 9.5e-6:
		tmp = (t1 * -v) / (u * u)
	else:
		tmp = t_1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -2e+67)
		tmp = t_1;
	elseif (t1 <= 9.5e-6)
		tmp = Float64(Float64(t1 * Float64(-v)) / Float64(u * u));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -2e+67)
		tmp = t_1;
	elseif (t1 <= 9.5e-6)
		tmp = (t1 * -v) / (u * u);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2e+67], t$95$1, If[LessEqual[t1, 9.5e-6], N[(N[(t1 * (-v)), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -2 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{t1 \cdot \left(-v\right)}{u \cdot u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.99999999999999997e67 or 9.5000000000000005e-6 < t1

    1. Initial program 53.0%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. 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)}} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1 \cdot \frac{v}{u}}}{t1 + u} \]
    9. Applied rewrites18.0%

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    12. Applied rewrites88.6%

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

    if -1.99999999999999997e67 < t1 < 9.5000000000000005e-6

    1. Initial program 81.6%

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

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

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

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

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

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

Alternative 7: 75.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -2 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-6}:\\ \;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))))
   (if (<= t1 -2e+67) t_1 (if (<= t1 9.5e-6) (* (- t1) (/ v (* u u))) t_1))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2e+67) {
		tmp = t_1;
	} else if (t1 <= 9.5e-6) {
		tmp = -t1 * (v / (u * u));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / (t1 + u)
    if (t1 <= (-2d+67)) then
        tmp = t_1
    else if (t1 <= 9.5d-6) then
        tmp = -t1 * (v / (u * u))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -2e+67) {
		tmp = t_1;
	} else if (t1 <= 9.5e-6) {
		tmp = -t1 * (v / (u * u));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	tmp = 0
	if t1 <= -2e+67:
		tmp = t_1
	elif t1 <= 9.5e-6:
		tmp = -t1 * (v / (u * u))
	else:
		tmp = t_1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -2e+67)
		tmp = t_1;
	elseif (t1 <= 9.5e-6)
		tmp = Float64(Float64(-t1) * Float64(v / Float64(u * u)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -2e+67)
		tmp = t_1;
	elseif (t1 <= 9.5e-6)
		tmp = -t1 * (v / (u * u));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -2e+67], t$95$1, If[LessEqual[t1, 9.5e-6], N[((-t1) * N[(v / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -2 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 9.5 \cdot 10^{-6}:\\
\;\;\;\;\left(-t1\right) \cdot \frac{v}{u \cdot u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.99999999999999997e67 or 9.5000000000000005e-6 < t1

    1. Initial program 53.0%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. 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)}} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1 \cdot \frac{v}{u}}}{t1 + u} \]
    9. Applied rewrites18.0%

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    12. Applied rewrites88.6%

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

    if -1.99999999999999997e67 < t1 < 9.5000000000000005e-6

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t1 \cdot \frac{v}{\color{blue}{u \cdot \left(\mathsf{neg}\left(u\right)\right)}} \]
      14. lower-neg.f6469.3

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

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

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

Alternative 8: 98.0% accurate, 0.8× speedup?

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

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

    \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    2. 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)} \]
    3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 67.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := v \cdot \frac{t1}{u \cdot u}\\ \mathbf{if}\;u \leq -2.4 \cdot 10^{+157}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;u \leq 9 \cdot 10^{+201}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* v (/ t1 (* u u)))))
   (if (<= u -2.4e+157) t_1 (if (<= u 9e+201) (/ (- v) (+ t1 u)) t_1))))
double code(double u, double v, double t1) {
	double t_1 = v * (t1 / (u * u));
	double tmp;
	if (u <= -2.4e+157) {
		tmp = t_1;
	} else if (u <= 9e+201) {
		tmp = -v / (t1 + u);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = v * (t1 / (u * u))
    if (u <= (-2.4d+157)) then
        tmp = t_1
    else if (u <= 9d+201) then
        tmp = -v / (t1 + u)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v * (t1 / (u * u));
	double tmp;
	if (u <= -2.4e+157) {
		tmp = t_1;
	} else if (u <= 9e+201) {
		tmp = -v / (t1 + u);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v * (t1 / (u * u))
	tmp = 0
	if u <= -2.4e+157:
		tmp = t_1
	elif u <= 9e+201:
		tmp = -v / (t1 + u)
	else:
		tmp = t_1
	return tmp
function code(u, v, t1)
	t_1 = Float64(v * Float64(t1 / Float64(u * u)))
	tmp = 0.0
	if (u <= -2.4e+157)
		tmp = t_1;
	elseif (u <= 9e+201)
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v * (t1 / (u * u));
	tmp = 0.0;
	if (u <= -2.4e+157)
		tmp = t_1;
	elseif (u <= 9e+201)
		tmp = -v / (t1 + u);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[(t1 / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -2.4e+157], t$95$1, If[LessEqual[u, 9e+201], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := v \cdot \frac{t1}{u \cdot u}\\
\mathbf{if}\;u \leq -2.4 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;u \leq 9 \cdot 10^{+201}:\\
\;\;\;\;\frac{-v}{t1 + u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.4e157 or 9.0000000000000002e201 < u

    1. Initial program 72.0%

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

      if -2.4e157 < u < 9.0000000000000002e201

      1. Initial program 67.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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
        2. 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)} \]
        3. 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)}} \]
        4. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(t1 \cdot \frac{v}{u}\right)}{t1 + u}} \]
        6. lower-neg.f6440.4

          \[\leadsto \frac{\color{blue}{-t1 \cdot \frac{v}{u}}}{t1 + u} \]
      9. Applied rewrites38.2%

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

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

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(v\right)}}{t1 + u} \]
        2. lower-neg.f6464.8

          \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
      12. Applied rewrites64.8%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Recombined 2 regimes into one program.
    10. Final simplification66.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.4 \cdot 10^{+157}:\\ \;\;\;\;v \cdot \frac{t1}{u \cdot u}\\ \mathbf{elif}\;u \leq 9 \cdot 10^{+201}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{t1}{u \cdot u}\\ \end{array} \]
    11. Add Preprocessing

    Alternative 10: 61.6% accurate, 1.8× speedup?

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

      \[\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(\mathsf{neg}\left(t1\right)\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. 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)} \]
      3. 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)}} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(\frac{t1}{t1 + u}\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(v\right)\right)}}{\mathsf{neg}\left(\left(t1 + u\right)\right)} \]
      14. lower-neg.f6497.6

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(t1 \cdot \frac{v}{u}\right)}{t1 + u}} \]
      6. lower-neg.f6451.3

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    12. Applied rewrites58.9%

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

    Alternative 11: 53.8% 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);
    }
    
    real(8) function code(u, v, t1)
        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 68.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
    6. Final simplification53.3%

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

    Reproduce

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