Rosa's DopplerBench

Percentage Accurate: 72.5% → 97.8%
Time: 8.7s
Alternatives: 14
Speedup: 1.0×

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 14 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.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));
}
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: 97.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{-t1}{\frac{t1 + u}{v}}}{t1 + 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(Float64(t1 + u) / 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[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{-t1}{\frac{t1 + u}{v}}}{t1 + u}
\end{array}
Derivation
  1. Initial program 73.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-/r*83.5%

      \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
    2. associate-/l*97.2%

      \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
  3. Simplified97.2%

    \[\leadsto \color{blue}{\frac{\frac{-t1}{\frac{t1 + u}{v}}}{t1 + u}} \]
  4. Final simplification97.2%

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

Alternative 2: 89.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ t_2 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{if}\;t1 \leq -3.3 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq -3.2 \cdot 10^{-201}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq 2.2 \cdot 10^{-149}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+86}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))) (t_2 (* v (/ (- t1) (* (+ t1 u) (+ t1 u))))))
   (if (<= t1 -3.3e+80)
     t_1
     (if (<= t1 -3.2e-201)
       t_2
       (if (<= t1 2.2e-149)
         (/ (/ (- t1) (/ u v)) (+ t1 u))
         (if (<= t1 2.3e+86) t_2 t_1))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double t_2 = v * (-t1 / ((t1 + u) * (t1 + u)));
	double tmp;
	if (t1 <= -3.3e+80) {
		tmp = t_1;
	} else if (t1 <= -3.2e-201) {
		tmp = t_2;
	} else if (t1 <= 2.2e-149) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if (t1 <= 2.3e+86) {
		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 + u)
    t_2 = v * (-t1 / ((t1 + u) * (t1 + u)))
    if (t1 <= (-3.3d+80)) then
        tmp = t_1
    else if (t1 <= (-3.2d-201)) then
        tmp = t_2
    else if (t1 <= 2.2d-149) then
        tmp = (-t1 / (u / v)) / (t1 + u)
    else if (t1 <= 2.3d+86) 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 + u);
	double t_2 = v * (-t1 / ((t1 + u) * (t1 + u)));
	double tmp;
	if (t1 <= -3.3e+80) {
		tmp = t_1;
	} else if (t1 <= -3.2e-201) {
		tmp = t_2;
	} else if (t1 <= 2.2e-149) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if (t1 <= 2.3e+86) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	t_2 = v * (-t1 / ((t1 + u) * (t1 + u)))
	tmp = 0
	if t1 <= -3.3e+80:
		tmp = t_1
	elif t1 <= -3.2e-201:
		tmp = t_2
	elif t1 <= 2.2e-149:
		tmp = (-t1 / (u / v)) / (t1 + u)
	elif t1 <= 2.3e+86:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	t_2 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u))))
	tmp = 0.0
	if (t1 <= -3.3e+80)
		tmp = t_1;
	elseif (t1 <= -3.2e-201)
		tmp = t_2;
	elseif (t1 <= 2.2e-149)
		tmp = Float64(Float64(Float64(-t1) / Float64(u / v)) / Float64(t1 + u));
	elseif (t1 <= 2.3e+86)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	t_2 = v * (-t1 / ((t1 + u) * (t1 + u)));
	tmp = 0.0;
	if (t1 <= -3.3e+80)
		tmp = t_1;
	elseif (t1 <= -3.2e-201)
		tmp = t_2;
	elseif (t1 <= 2.2e-149)
		tmp = (-t1 / (u / v)) / (t1 + u);
	elseif (t1 <= 2.3e+86)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.3e+80], t$95$1, If[LessEqual[t1, -3.2e-201], t$95$2, If[LessEqual[t1, 2.2e-149], N[(N[((-t1) / N[(u / v), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.3e+86], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t1 \leq -3.2 \cdot 10^{-201}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+86}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -3.29999999999999991e80 or 2.2999999999999999e86 < t1

    1. Initial program 60.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*77.1%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*99.2%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified99.2%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    5. Step-by-step derivation
      1. neg-mul-192.2%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    6. Simplified92.2%

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

    if -3.29999999999999991e80 < t1 < -3.2000000000000001e-201 or 2.1999999999999998e-149 < t1 < 2.2999999999999999e86

    1. Initial program 89.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/94.5%

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

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

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

    if -3.2000000000000001e-201 < t1 < 2.1999999999999998e-149

    1. Initial program 72.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*79.6%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*89.5%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified89.5%

      \[\leadsto \color{blue}{\frac{\frac{-t1}{\frac{t1 + u}{v}}}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 78.1%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{t1 \cdot v}{u}}}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg78.1%

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

        \[\leadsto \frac{-\color{blue}{\frac{t1}{\frac{u}{v}}}}{t1 + u} \]
      3. distribute-neg-frac83.4%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{u}{v}}}}{t1 + u} \]
    6. Simplified83.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.3 \cdot 10^{+80}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq -3.2 \cdot 10^{-201}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 2.2 \cdot 10^{-149}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 2.3 \cdot 10^{+86}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]

Alternative 3: 75.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37} \lor \neg \left(t1 \leq 2.5 \cdot 10^{-86} \lor \neg \left(t1 \leq 1.3 \cdot 10^{-9}\right) \land t1 \leq 29.5\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -1.22e+37)
         (not (or (<= t1 2.5e-86) (and (not (<= t1 1.3e-9)) (<= t1 29.5)))))
   (/ (- v) (+ t1 u))
   (* v (/ (- t1) (* u u)))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.22e+37) || !((t1 <= 2.5e-86) || (!(t1 <= 1.3e-9) && (t1 <= 29.5)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = v * (-t1 / (u * u));
	}
	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) :: tmp
    if ((t1 <= (-1.22d+37)) .or. (.not. (t1 <= 2.5d-86) .or. (.not. (t1 <= 1.3d-9)) .and. (t1 <= 29.5d0))) then
        tmp = -v / (t1 + u)
    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 <= -1.22e+37) || !((t1 <= 2.5e-86) || (!(t1 <= 1.3e-9) && (t1 <= 29.5)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = v * (-t1 / (u * u));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -1.22e+37) or not ((t1 <= 2.5e-86) or (not (t1 <= 1.3e-9) and (t1 <= 29.5))):
		tmp = -v / (t1 + u)
	else:
		tmp = v * (-t1 / (u * u))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -1.22e+37) || !((t1 <= 2.5e-86) || (!(t1 <= 1.3e-9) && (t1 <= 29.5))))
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	else
		tmp = Float64(v * Float64(Float64(-t1) / Float64(u * u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -1.22e+37) || ~(((t1 <= 2.5e-86) || (~((t1 <= 1.3e-9)) && (t1 <= 29.5)))))
		tmp = -v / (t1 + u);
	else
		tmp = v * (-t1 / (u * u));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.22e+37], N[Not[Or[LessEqual[t1, 2.5e-86], And[N[Not[LessEqual[t1, 1.3e-9]], $MachinePrecision], LessEqual[t1, 29.5]]]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(v * N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37} \lor \neg \left(t1 \leq 2.5 \cdot 10^{-86} \lor \neg \left(t1 \leq 1.3 \cdot 10^{-9}\right) \land t1 \leq 29.5\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.22e37 or 2.4999999999999999e-86 < t1 < 1.3000000000000001e-9 or 29.5 < t1

    1. Initial program 67.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*80.9%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*99.4%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified99.4%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    5. Step-by-step derivation
      1. neg-mul-187.9%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    6. Simplified87.9%

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

    if -1.22e37 < t1 < 2.4999999999999999e-86 or 1.3000000000000001e-9 < t1 < 29.5

    1. Initial program 80.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.2%

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

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

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

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

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot t1}{{u}^{2}}} \]
      2. neg-mul-176.3%

        \[\leadsto v \cdot \frac{\color{blue}{-t1}}{{u}^{2}} \]
      3. unpow276.3%

        \[\leadsto v \cdot \frac{-t1}{\color{blue}{u \cdot u}} \]
    6. Simplified76.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37} \lor \neg \left(t1 \leq 2.5 \cdot 10^{-86} \lor \neg \left(t1 \leq 1.3 \cdot 10^{-9}\right) \land t1 \leq 29.5\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{-t1}{u \cdot u}\\ \end{array} \]

Alternative 4: 76.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37} \lor \neg \left(t1 \leq 1.8 \cdot 10^{-87} \lor \neg \left(t1 \leq 1.6 \cdot 10^{-8}\right) \land t1 \leq 7.2 \cdot 10^{+71}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u}}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -1.22e+37)
         (not (or (<= t1 1.8e-87) (and (not (<= t1 1.6e-8)) (<= t1 7.2e+71)))))
   (/ (- v) (+ t1 u))
   (* (- v) (/ (/ t1 u) u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.22e+37) || !((t1 <= 1.8e-87) || (!(t1 <= 1.6e-8) && (t1 <= 7.2e+71)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = -v * ((t1 / u) / u);
	}
	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) :: tmp
    if ((t1 <= (-1.22d+37)) .or. (.not. (t1 <= 1.8d-87) .or. (.not. (t1 <= 1.6d-8)) .and. (t1 <= 7.2d+71))) then
        tmp = -v / (t1 + u)
    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 <= -1.22e+37) || !((t1 <= 1.8e-87) || (!(t1 <= 1.6e-8) && (t1 <= 7.2e+71)))) {
		tmp = -v / (t1 + u);
	} else {
		tmp = -v * ((t1 / u) / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -1.22e+37) or not ((t1 <= 1.8e-87) or (not (t1 <= 1.6e-8) and (t1 <= 7.2e+71))):
		tmp = -v / (t1 + u)
	else:
		tmp = -v * ((t1 / u) / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -1.22e+37) || !((t1 <= 1.8e-87) || (!(t1 <= 1.6e-8) && (t1 <= 7.2e+71))))
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	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 <= -1.22e+37) || ~(((t1 <= 1.8e-87) || (~((t1 <= 1.6e-8)) && (t1 <= 7.2e+71)))))
		tmp = -v / (t1 + u);
	else
		tmp = -v * ((t1 / u) / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.22e+37], N[Not[Or[LessEqual[t1, 1.8e-87], And[N[Not[LessEqual[t1, 1.6e-8]], $MachinePrecision], LessEqual[t1, 7.2e+71]]]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[((-v) * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37} \lor \neg \left(t1 \leq 1.8 \cdot 10^{-87} \lor \neg \left(t1 \leq 1.6 \cdot 10^{-8}\right) \land t1 \leq 7.2 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\

\mathbf{else}:\\
\;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u}}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.22e37 or 1.79999999999999996e-87 < t1 < 1.6000000000000001e-8 or 7.1999999999999999e71 < t1

    1. Initial program 66.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*80.6%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*99.4%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified99.4%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    5. Step-by-step derivation
      1. neg-mul-191.3%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    6. Simplified91.3%

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

    if -1.22e37 < t1 < 1.79999999999999996e-87 or 1.6000000000000001e-8 < t1 < 7.1999999999999999e71

    1. Initial program 80.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.3%

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

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

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

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

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot t1}{{u}^{2}}} \]
      2. neg-mul-173.1%

        \[\leadsto v \cdot \frac{\color{blue}{-t1}}{{u}^{2}} \]
      3. unpow273.1%

        \[\leadsto v \cdot \frac{-t1}{\color{blue}{u \cdot u}} \]
    6. Simplified73.1%

      \[\leadsto v \cdot \color{blue}{\frac{-t1}{u \cdot u}} \]
    7. Step-by-step derivation
      1. neg-mul-173.1%

        \[\leadsto v \cdot \frac{\color{blue}{-1 \cdot t1}}{u \cdot u} \]
      2. times-frac79.5%

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

      \[\leadsto v \cdot \color{blue}{\left(\frac{-1}{u} \cdot \frac{t1}{u}\right)} \]
    9. Step-by-step derivation
      1. associate-*l/79.5%

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot \frac{t1}{u}}{u}} \]
      2. mul-1-neg79.5%

        \[\leadsto v \cdot \frac{\color{blue}{-\frac{t1}{u}}}{u} \]
    10. Simplified79.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37} \lor \neg \left(t1 \leq 1.8 \cdot 10^{-87} \lor \neg \left(t1 \leq 1.6 \cdot 10^{-8}\right) \land t1 \leq 7.2 \cdot 10^{+71}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u}}{u}\\ \end{array} \]

Alternative 5: 76.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 3.4 \cdot 10^{-85}:\\ \;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u}}{u}\\ \mathbf{elif}\;t1 \leq 4.6 \cdot 10^{-9} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\frac{-u}{\frac{v}{u}}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))))
   (if (<= t1 -1.22e+37)
     t_1
     (if (<= t1 3.4e-85)
       (* (- v) (/ (/ t1 u) u))
       (if (or (<= t1 4.6e-9) (not (<= t1 4.2e+86)))
         t_1
         (/ t1 (/ (- u) (/ v u))))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -1.22e+37) {
		tmp = t_1;
	} else if (t1 <= 3.4e-85) {
		tmp = -v * ((t1 / u) / u);
	} else if ((t1 <= 4.6e-9) || !(t1 <= 4.2e+86)) {
		tmp = t_1;
	} else {
		tmp = t1 / (-u / (v / u));
	}
	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 <= (-1.22d+37)) then
        tmp = t_1
    else if (t1 <= 3.4d-85) then
        tmp = -v * ((t1 / u) / u)
    else if ((t1 <= 4.6d-9) .or. (.not. (t1 <= 4.2d+86))) then
        tmp = t_1
    else
        tmp = t1 / (-u / (v / u))
    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 <= -1.22e+37) {
		tmp = t_1;
	} else if (t1 <= 3.4e-85) {
		tmp = -v * ((t1 / u) / u);
	} else if ((t1 <= 4.6e-9) || !(t1 <= 4.2e+86)) {
		tmp = t_1;
	} else {
		tmp = t1 / (-u / (v / u));
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	tmp = 0
	if t1 <= -1.22e+37:
		tmp = t_1
	elif t1 <= 3.4e-85:
		tmp = -v * ((t1 / u) / u)
	elif (t1 <= 4.6e-9) or not (t1 <= 4.2e+86):
		tmp = t_1
	else:
		tmp = t1 / (-u / (v / u))
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -1.22e+37)
		tmp = t_1;
	elseif (t1 <= 3.4e-85)
		tmp = Float64(Float64(-v) * Float64(Float64(t1 / u) / u));
	elseif ((t1 <= 4.6e-9) || !(t1 <= 4.2e+86))
		tmp = t_1;
	else
		tmp = Float64(t1 / Float64(Float64(-u) / Float64(v / u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -1.22e+37)
		tmp = t_1;
	elseif (t1 <= 3.4e-85)
		tmp = -v * ((t1 / u) / u);
	elseif ((t1 <= 4.6e-9) || ~((t1 <= 4.2e+86)))
		tmp = t_1;
	else
		tmp = t1 / (-u / (v / u));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.22e+37], t$95$1, If[LessEqual[t1, 3.4e-85], N[((-v) * N[(N[(t1 / u), $MachinePrecision] / u), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 4.6e-9], N[Not[LessEqual[t1, 4.2e+86]], $MachinePrecision]], t$95$1, N[(t1 / N[((-u) / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq 4.6 \cdot 10^{-9} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.22e37 or 3.4e-85 < t1 < 4.5999999999999998e-9 or 4.1999999999999998e86 < t1

    1. Initial program 67.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*81.2%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*99.4%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified99.4%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    5. Step-by-step derivation
      1. neg-mul-192.0%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    6. Simplified92.0%

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

    if -1.22e37 < t1 < 3.4e-85

    1. Initial program 79.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/81.4%

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

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

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

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

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot t1}{{u}^{2}}} \]
      2. neg-mul-175.2%

        \[\leadsto v \cdot \frac{\color{blue}{-t1}}{{u}^{2}} \]
      3. unpow275.2%

        \[\leadsto v \cdot \frac{-t1}{\color{blue}{u \cdot u}} \]
    6. Simplified75.2%

      \[\leadsto v \cdot \color{blue}{\frac{-t1}{u \cdot u}} \]
    7. Step-by-step derivation
      1. neg-mul-175.2%

        \[\leadsto v \cdot \frac{\color{blue}{-1 \cdot t1}}{u \cdot u} \]
      2. times-frac81.7%

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

      \[\leadsto v \cdot \color{blue}{\left(\frac{-1}{u} \cdot \frac{t1}{u}\right)} \]
    9. Step-by-step derivation
      1. associate-*l/81.7%

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot \frac{t1}{u}}{u}} \]
      2. mul-1-neg81.7%

        \[\leadsto v \cdot \frac{\color{blue}{-\frac{t1}{u}}}{u} \]
    10. Simplified81.7%

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

    if 4.5999999999999998e-9 < t1 < 4.1999999999999998e86

    1. Initial program 77.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/83.7%

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

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

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Step-by-step derivation
      1. associate-/r*89.1%

        \[\leadsto v \cdot \color{blue}{\frac{\frac{-t1}{t1 + u}}{t1 + u}} \]
      2. associate-*r/99.7%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{-t1}{t1 + u}}{t1 + u}} \]
      3. *-commutative99.7%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{t1 + u} \cdot v}}{t1 + u} \]
      4. associate-/r/99.3%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
      5. div-inv99.5%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{t1 + u}{v}} \cdot \frac{1}{t1 + u}} \]
      6. frac-2neg99.5%

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

        \[\leadsto \color{blue}{\frac{\left(-\left(-t1\right)\right) \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)}} \]
      8. remove-double-neg99.3%

        \[\leadsto \frac{\color{blue}{t1} \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      9. *-commutative99.3%

        \[\leadsto \frac{\color{blue}{1 \cdot t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      10. *-un-lft-identity99.3%

        \[\leadsto \frac{\color{blue}{t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      11. distribute-neg-frac99.3%

        \[\leadsto \frac{t1}{\color{blue}{\frac{-\left(t1 + u\right)}{v}} \cdot \left(t1 + u\right)} \]
      12. distribute-neg-in99.3%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{v} \cdot \left(t1 + u\right)} \]
      13. add-sqr-sqrt0.0%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      14. sqrt-unprod72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      15. sqr-neg72.1%

        \[\leadsto \frac{t1}{\frac{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      16. sqrt-unprod72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      17. add-sqr-sqrt72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{t1} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      18. sub-neg72.1%

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

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

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

        \[\leadsto \frac{t1}{-1 \cdot \frac{\color{blue}{u \cdot u}}{v}} \]
      2. neg-mul-156.5%

        \[\leadsto \frac{t1}{\color{blue}{-\frac{u \cdot u}{v}}} \]
      3. associate-/l*72.4%

        \[\leadsto \frac{t1}{-\color{blue}{\frac{u}{\frac{v}{u}}}} \]
      4. distribute-neg-frac72.4%

        \[\leadsto \frac{t1}{\color{blue}{\frac{-u}{\frac{v}{u}}}} \]
    8. Simplified72.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.22 \cdot 10^{+37}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 3.4 \cdot 10^{-85}:\\ \;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{u}}{u}\\ \mathbf{elif}\;t1 \leq 4.6 \cdot 10^{-9} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\frac{-u}{\frac{v}{u}}}\\ \end{array} \]

Alternative 6: 76.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -7.8 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-88}:\\ \;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{-u}\\ \mathbf{elif}\;t1 \leq 3.5 \cdot 10^{-9} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\frac{-u}{\frac{v}{u}}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))))
   (if (<= t1 -7.8e+39)
     t_1
     (if (<= t1 5.2e-88)
       (/ (/ v (/ u t1)) (- u))
       (if (or (<= t1 3.5e-9) (not (<= t1 4.2e+86)))
         t_1
         (/ t1 (/ (- u) (/ v u))))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -7.8e+39) {
		tmp = t_1;
	} else if (t1 <= 5.2e-88) {
		tmp = (v / (u / t1)) / -u;
	} else if ((t1 <= 3.5e-9) || !(t1 <= 4.2e+86)) {
		tmp = t_1;
	} else {
		tmp = t1 / (-u / (v / u));
	}
	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 <= (-7.8d+39)) then
        tmp = t_1
    else if (t1 <= 5.2d-88) then
        tmp = (v / (u / t1)) / -u
    else if ((t1 <= 3.5d-9) .or. (.not. (t1 <= 4.2d+86))) then
        tmp = t_1
    else
        tmp = t1 / (-u / (v / u))
    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 <= -7.8e+39) {
		tmp = t_1;
	} else if (t1 <= 5.2e-88) {
		tmp = (v / (u / t1)) / -u;
	} else if ((t1 <= 3.5e-9) || !(t1 <= 4.2e+86)) {
		tmp = t_1;
	} else {
		tmp = t1 / (-u / (v / u));
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	tmp = 0
	if t1 <= -7.8e+39:
		tmp = t_1
	elif t1 <= 5.2e-88:
		tmp = (v / (u / t1)) / -u
	elif (t1 <= 3.5e-9) or not (t1 <= 4.2e+86):
		tmp = t_1
	else:
		tmp = t1 / (-u / (v / u))
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -7.8e+39)
		tmp = t_1;
	elseif (t1 <= 5.2e-88)
		tmp = Float64(Float64(v / Float64(u / t1)) / Float64(-u));
	elseif ((t1 <= 3.5e-9) || !(t1 <= 4.2e+86))
		tmp = t_1;
	else
		tmp = Float64(t1 / Float64(Float64(-u) / Float64(v / u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -7.8e+39)
		tmp = t_1;
	elseif (t1 <= 5.2e-88)
		tmp = (v / (u / t1)) / -u;
	elseif ((t1 <= 3.5e-9) || ~((t1 <= 4.2e+86)))
		tmp = t_1;
	else
		tmp = t1 / (-u / (v / u));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -7.8e+39], t$95$1, If[LessEqual[t1, 5.2e-88], N[(N[(v / N[(u / t1), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[Or[LessEqual[t1, 3.5e-9], N[Not[LessEqual[t1, 4.2e+86]], $MachinePrecision]], t$95$1, N[(t1 / N[((-u) / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -7.8 \cdot 10^{+39}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq 3.5 \cdot 10^{-9} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -7.8000000000000002e39 or 5.20000000000000027e-88 < t1 < 3.4999999999999999e-9 or 4.1999999999999998e86 < t1

    1. Initial program 67.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*81.2%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*99.4%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified99.4%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    5. Step-by-step derivation
      1. neg-mul-192.0%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    6. Simplified92.0%

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

    if -7.8000000000000002e39 < t1 < 5.20000000000000027e-88

    1. Initial program 79.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/81.4%

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

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

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

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

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot t1}{{u}^{2}}} \]
      2. neg-mul-175.2%

        \[\leadsto v \cdot \frac{\color{blue}{-t1}}{{u}^{2}} \]
      3. unpow275.2%

        \[\leadsto v \cdot \frac{-t1}{\color{blue}{u \cdot u}} \]
    6. Simplified75.2%

      \[\leadsto v \cdot \color{blue}{\frac{-t1}{u \cdot u}} \]
    7. Step-by-step derivation
      1. associate-*r/75.4%

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

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{u \cdot u} \]
      3. associate-/r*80.1%

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

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

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

    if 3.4999999999999999e-9 < t1 < 4.1999999999999998e86

    1. Initial program 77.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/83.7%

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

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

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Step-by-step derivation
      1. associate-/r*89.1%

        \[\leadsto v \cdot \color{blue}{\frac{\frac{-t1}{t1 + u}}{t1 + u}} \]
      2. associate-*r/99.7%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{-t1}{t1 + u}}{t1 + u}} \]
      3. *-commutative99.7%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{t1 + u} \cdot v}}{t1 + u} \]
      4. associate-/r/99.3%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
      5. div-inv99.5%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{t1 + u}{v}} \cdot \frac{1}{t1 + u}} \]
      6. frac-2neg99.5%

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

        \[\leadsto \color{blue}{\frac{\left(-\left(-t1\right)\right) \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)}} \]
      8. remove-double-neg99.3%

        \[\leadsto \frac{\color{blue}{t1} \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      9. *-commutative99.3%

        \[\leadsto \frac{\color{blue}{1 \cdot t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      10. *-un-lft-identity99.3%

        \[\leadsto \frac{\color{blue}{t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      11. distribute-neg-frac99.3%

        \[\leadsto \frac{t1}{\color{blue}{\frac{-\left(t1 + u\right)}{v}} \cdot \left(t1 + u\right)} \]
      12. distribute-neg-in99.3%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{v} \cdot \left(t1 + u\right)} \]
      13. add-sqr-sqrt0.0%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      14. sqrt-unprod72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      15. sqr-neg72.1%

        \[\leadsto \frac{t1}{\frac{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      16. sqrt-unprod72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      17. add-sqr-sqrt72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{t1} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      18. sub-neg72.1%

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

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

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

        \[\leadsto \frac{t1}{-1 \cdot \frac{\color{blue}{u \cdot u}}{v}} \]
      2. neg-mul-156.5%

        \[\leadsto \frac{t1}{\color{blue}{-\frac{u \cdot u}{v}}} \]
      3. associate-/l*72.4%

        \[\leadsto \frac{t1}{-\color{blue}{\frac{u}{\frac{v}{u}}}} \]
      4. distribute-neg-frac72.4%

        \[\leadsto \frac{t1}{\color{blue}{\frac{-u}{\frac{v}{u}}}} \]
    8. Simplified72.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -7.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 5.2 \cdot 10^{-88}:\\ \;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{-u}\\ \mathbf{elif}\;t1 \leq 3.5 \cdot 10^{-9} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\frac{-u}{\frac{v}{u}}}\\ \end{array} \]

Alternative 7: 76.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1 + u}\\ \mathbf{if}\;t1 \leq -3.15 \cdot 10^{+38}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 6 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{-8} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\frac{-u}{\frac{v}{u}}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) (+ t1 u))))
   (if (<= t1 -3.15e+38)
     t_1
     (if (<= t1 6e-85)
       (/ (/ (- t1) (/ u v)) (+ t1 u))
       (if (or (<= t1 1.5e-8) (not (<= t1 4.2e+86)))
         t_1
         (/ t1 (/ (- u) (/ v u))))))))
double code(double u, double v, double t1) {
	double t_1 = -v / (t1 + u);
	double tmp;
	if (t1 <= -3.15e+38) {
		tmp = t_1;
	} else if (t1 <= 6e-85) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if ((t1 <= 1.5e-8) || !(t1 <= 4.2e+86)) {
		tmp = t_1;
	} else {
		tmp = t1 / (-u / (v / u));
	}
	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 <= (-3.15d+38)) then
        tmp = t_1
    else if (t1 <= 6d-85) then
        tmp = (-t1 / (u / v)) / (t1 + u)
    else if ((t1 <= 1.5d-8) .or. (.not. (t1 <= 4.2d+86))) then
        tmp = t_1
    else
        tmp = t1 / (-u / (v / u))
    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 <= -3.15e+38) {
		tmp = t_1;
	} else if (t1 <= 6e-85) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if ((t1 <= 1.5e-8) || !(t1 <= 4.2e+86)) {
		tmp = t_1;
	} else {
		tmp = t1 / (-u / (v / u));
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / (t1 + u)
	tmp = 0
	if t1 <= -3.15e+38:
		tmp = t_1
	elif t1 <= 6e-85:
		tmp = (-t1 / (u / v)) / (t1 + u)
	elif (t1 <= 1.5e-8) or not (t1 <= 4.2e+86):
		tmp = t_1
	else:
		tmp = t1 / (-u / (v / u))
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / Float64(t1 + u))
	tmp = 0.0
	if (t1 <= -3.15e+38)
		tmp = t_1;
	elseif (t1 <= 6e-85)
		tmp = Float64(Float64(Float64(-t1) / Float64(u / v)) / Float64(t1 + u));
	elseif ((t1 <= 1.5e-8) || !(t1 <= 4.2e+86))
		tmp = t_1;
	else
		tmp = Float64(t1 / Float64(Float64(-u) / Float64(v / u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / (t1 + u);
	tmp = 0.0;
	if (t1 <= -3.15e+38)
		tmp = t_1;
	elseif (t1 <= 6e-85)
		tmp = (-t1 / (u / v)) / (t1 + u);
	elseif ((t1 <= 1.5e-8) || ~((t1 <= 4.2e+86)))
		tmp = t_1;
	else
		tmp = t1 / (-u / (v / u));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3.15e+38], t$95$1, If[LessEqual[t1, 6e-85], N[(N[((-t1) / N[(u / v), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, 1.5e-8], N[Not[LessEqual[t1, 4.2e+86]], $MachinePrecision]], t$95$1, N[(t1 / N[((-u) / N[(v / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{-v}{t1 + u}\\
\mathbf{if}\;t1 \leq -3.15 \cdot 10^{+38}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq 1.5 \cdot 10^{-8} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -3.15000000000000001e38 or 6.00000000000000044e-85 < t1 < 1.49999999999999987e-8 or 4.1999999999999998e86 < t1

    1. Initial program 67.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*81.2%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*99.4%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified99.4%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    5. Step-by-step derivation
      1. neg-mul-192.0%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    6. Simplified92.0%

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

    if -3.15000000000000001e38 < t1 < 6.00000000000000044e-85

    1. Initial program 79.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*86.2%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*94.2%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified94.2%

      \[\leadsto \color{blue}{\frac{\frac{-t1}{\frac{t1 + u}{v}}}{t1 + u}} \]
    4. Taylor expanded in t1 around 0 80.1%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{t1 \cdot v}{u}}}{t1 + u} \]
    5. Step-by-step derivation
      1. mul-1-neg80.1%

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

        \[\leadsto \frac{-\color{blue}{\frac{t1}{\frac{u}{v}}}}{t1 + u} \]
      3. distribute-neg-frac83.9%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{u}{v}}}}{t1 + u} \]
    6. Simplified83.9%

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

    if 1.49999999999999987e-8 < t1 < 4.1999999999999998e86

    1. Initial program 77.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/83.7%

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

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

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Step-by-step derivation
      1. associate-/r*89.1%

        \[\leadsto v \cdot \color{blue}{\frac{\frac{-t1}{t1 + u}}{t1 + u}} \]
      2. associate-*r/99.7%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{-t1}{t1 + u}}{t1 + u}} \]
      3. *-commutative99.7%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{t1 + u} \cdot v}}{t1 + u} \]
      4. associate-/r/99.3%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
      5. div-inv99.5%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{t1 + u}{v}} \cdot \frac{1}{t1 + u}} \]
      6. frac-2neg99.5%

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

        \[\leadsto \color{blue}{\frac{\left(-\left(-t1\right)\right) \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)}} \]
      8. remove-double-neg99.3%

        \[\leadsto \frac{\color{blue}{t1} \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      9. *-commutative99.3%

        \[\leadsto \frac{\color{blue}{1 \cdot t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      10. *-un-lft-identity99.3%

        \[\leadsto \frac{\color{blue}{t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
      11. distribute-neg-frac99.3%

        \[\leadsto \frac{t1}{\color{blue}{\frac{-\left(t1 + u\right)}{v}} \cdot \left(t1 + u\right)} \]
      12. distribute-neg-in99.3%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{v} \cdot \left(t1 + u\right)} \]
      13. add-sqr-sqrt0.0%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      14. sqrt-unprod72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      15. sqr-neg72.1%

        \[\leadsto \frac{t1}{\frac{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      16. sqrt-unprod72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      17. add-sqr-sqrt72.1%

        \[\leadsto \frac{t1}{\frac{\color{blue}{t1} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
      18. sub-neg72.1%

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

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

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

        \[\leadsto \frac{t1}{-1 \cdot \frac{\color{blue}{u \cdot u}}{v}} \]
      2. neg-mul-156.5%

        \[\leadsto \frac{t1}{\color{blue}{-\frac{u \cdot u}{v}}} \]
      3. associate-/l*72.4%

        \[\leadsto \frac{t1}{-\color{blue}{\frac{u}{\frac{v}{u}}}} \]
      4. distribute-neg-frac72.4%

        \[\leadsto \frac{t1}{\color{blue}{\frac{-u}{\frac{v}{u}}}} \]
    8. Simplified72.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.15 \cdot 10^{+38}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{elif}\;t1 \leq 6 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{-8} \lor \neg \left(t1 \leq 4.2 \cdot 10^{+86}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\frac{-u}{\frac{v}{u}}}\\ \end{array} \]

Alternative 8: 95.2% accurate, 1.0× speedup?

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

\\
v \cdot \frac{\frac{-t1}{t1 + u}}{t1 + u}
\end{array}
Derivation
  1. Initial program 73.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/76.3%

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

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

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

      \[\leadsto v \cdot \frac{\color{blue}{-1 \cdot t1}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. times-frac95.0%

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

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

      \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot \frac{t1}{t1 + u}}{t1 + u}} \]
    2. mul-1-neg95.0%

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

    \[\leadsto v \cdot \color{blue}{\frac{-\frac{t1}{t1 + u}}{t1 + u}} \]
  8. Final simplification95.0%

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

Alternative 9: 68.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.02 \cdot 10^{+127} \lor \neg \left(u \leq 7.2 \cdot 10^{+170}\right):\\
\;\;\;\;\frac{v}{\frac{u \cdot u}{t1}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.02e127 or 7.1999999999999999e170 < u

    1. Initial program 78.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/74.5%

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

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

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

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

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot t1}{{u}^{2}}} \]
      2. neg-mul-174.5%

        \[\leadsto v \cdot \frac{\color{blue}{-t1}}{{u}^{2}} \]
      3. unpow274.5%

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

      \[\leadsto v \cdot \color{blue}{\frac{-t1}{u \cdot u}} \]
    7. Step-by-step derivation
      1. clear-num74.5%

        \[\leadsto v \cdot \color{blue}{\frac{1}{\frac{u \cdot u}{-t1}}} \]
      2. un-div-inv74.5%

        \[\leadsto \color{blue}{\frac{v}{\frac{u \cdot u}{-t1}}} \]
      3. add-sqr-sqrt45.5%

        \[\leadsto \frac{v}{\frac{u \cdot u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}} \]
      4. sqrt-unprod56.1%

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

        \[\leadsto \frac{v}{\frac{u \cdot u}{\sqrt{\color{blue}{t1 \cdot t1}}}} \]
      6. sqrt-unprod29.0%

        \[\leadsto \frac{v}{\frac{u \cdot u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}} \]
      7. add-sqr-sqrt74.5%

        \[\leadsto \frac{v}{\frac{u \cdot u}{\color{blue}{t1}}} \]
    8. Applied egg-rr74.5%

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

    if -1.02e127 < u < 7.1999999999999999e170

    1. Initial program 71.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/r*82.2%

        \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
      2. associate-/l*96.3%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    3. Simplified96.3%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    5. Step-by-step derivation
      1. neg-mul-165.9%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    6. Simplified65.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.02 \cdot 10^{+127} \lor \neg \left(u \leq 7.2 \cdot 10^{+170}\right):\\ \;\;\;\;\frac{v}{\frac{u \cdot u}{t1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]

Alternative 10: 57.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.5 \cdot 10^{+83} \lor \neg \left(u \leq 3.25 \cdot 10^{+84}\right):\\
\;\;\;\;\frac{v}{t1 + u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -6.5000000000000003e83 or 3.25000000000000013e84 < u

    1. Initial program 79.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/74.0%

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

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

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

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

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

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

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot \frac{t1}{t1 + u}}{t1 + u}} \]
      2. mul-1-neg87.5%

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

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

      \[\leadsto v \cdot \frac{-\color{blue}{1}}{t1 + u} \]
    9. Step-by-step derivation
      1. expm1-log1p-u56.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(v \cdot \frac{-1}{t1 + u}\right)\right)} \]
      2. expm1-udef73.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(v \cdot \frac{-1}{t1 + u}\right)} - 1} \]
    10. Applied egg-rr69.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v}{t1 + u}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def47.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v}{t1 + u}\right)\right)} \]
      2. expm1-log1p47.8%

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

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

    if -6.5000000000000003e83 < u < 3.25000000000000013e84

    1. Initial program 69.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/77.5%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    5. Step-by-step derivation
      1. associate-*r/68.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-168.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -6.5 \cdot 10^{+83} \lor \neg \left(u \leq 3.25 \cdot 10^{+84}\right):\\ \;\;\;\;\frac{v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 11: 58.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.2 \cdot 10^{+158} \lor \neg \left(u \leq 5.8 \cdot 10^{+221}\right):\\
\;\;\;\;\frac{-v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.20000000000000004e158 or 5.7999999999999996e221 < u

    1. Initial program 83.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/83.4%

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

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

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

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

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

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

        \[\leadsto v \cdot \color{blue}{\frac{-1 \cdot \frac{t1}{t1 + u}}{t1 + u}} \]
      2. mul-1-neg91.7%

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

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

      \[\leadsto v \cdot \frac{-\color{blue}{1}}{t1 + u} \]
    9. Taylor expanded in t1 around 0 51.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    10. Step-by-step derivation
      1. neg-mul-151.6%

        \[\leadsto \color{blue}{-\frac{v}{u}} \]
      2. distribute-neg-frac51.6%

        \[\leadsto \color{blue}{\frac{-v}{u}} \]
    11. Simplified51.6%

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

    if -1.20000000000000004e158 < u < 5.7999999999999996e221

    1. Initial program 71.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/74.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    5. Step-by-step derivation
      1. associate-*r/62.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-162.0%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified62.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.2 \cdot 10^{+158} \lor \neg \left(u \leq 5.8 \cdot 10^{+221}\right):\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 12: 61.4% accurate, 2.0× 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 73.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-/r*83.5%

      \[\leadsto \color{blue}{\frac{\frac{\left(-t1\right) \cdot v}{t1 + u}}{t1 + u}} \]
    2. associate-/l*97.2%

      \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
  3. Simplified97.2%

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

    \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
  5. Step-by-step derivation
    1. neg-mul-163.1%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  6. Simplified63.1%

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

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

Alternative 13: 54.1% accurate, 3.0× 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 73.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/76.3%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
  5. Step-by-step derivation
    1. associate-*r/55.4%

      \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
    2. neg-mul-155.4%

      \[\leadsto \frac{\color{blue}{-v}}{t1} \]
  6. Simplified55.4%

    \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  7. Final simplification55.4%

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

Alternative 14: 14.3% accurate, 4.0× 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(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 73.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/76.3%

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

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

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Step-by-step derivation
    1. associate-/r*95.0%

      \[\leadsto v \cdot \color{blue}{\frac{\frac{-t1}{t1 + u}}{t1 + u}} \]
    2. associate-*r/97.2%

      \[\leadsto \color{blue}{\frac{v \cdot \frac{-t1}{t1 + u}}{t1 + u}} \]
    3. *-commutative97.2%

      \[\leadsto \frac{\color{blue}{\frac{-t1}{t1 + u} \cdot v}}{t1 + u} \]
    4. associate-/r/97.2%

      \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
    5. div-inv97.1%

      \[\leadsto \color{blue}{\frac{-t1}{\frac{t1 + u}{v}} \cdot \frac{1}{t1 + u}} \]
    6. frac-2neg97.1%

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

      \[\leadsto \color{blue}{\frac{\left(-\left(-t1\right)\right) \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)}} \]
    8. remove-double-neg80.8%

      \[\leadsto \frac{\color{blue}{t1} \cdot 1}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
    9. *-commutative80.8%

      \[\leadsto \frac{\color{blue}{1 \cdot t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
    10. *-un-lft-identity80.8%

      \[\leadsto \frac{\color{blue}{t1}}{\left(-\frac{t1 + u}{v}\right) \cdot \left(t1 + u\right)} \]
    11. distribute-neg-frac80.8%

      \[\leadsto \frac{t1}{\color{blue}{\frac{-\left(t1 + u\right)}{v}} \cdot \left(t1 + u\right)} \]
    12. distribute-neg-in80.8%

      \[\leadsto \frac{t1}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{v} \cdot \left(t1 + u\right)} \]
    13. add-sqr-sqrt42.8%

      \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
    14. sqrt-unprod66.3%

      \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
    15. sqr-neg66.3%

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

      \[\leadsto \frac{t1}{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
    17. add-sqr-sqrt60.0%

      \[\leadsto \frac{t1}{\frac{\color{blue}{t1} + \left(-u\right)}{v} \cdot \left(t1 + u\right)} \]
    18. sub-neg60.0%

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

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

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  7. Final simplification19.6%

    \[\leadsto \frac{v}{t1} \]

Reproduce

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