Rosa's DopplerBench

Percentage Accurate: 72.7% → 97.9%
Time: 8.1s
Alternatives: 13
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 13 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.7% 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.9% accurate, 1.0× speedup?

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

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.5%

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

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

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

Alternative 2: 75.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{u} \cdot \frac{-t1}{u}\\ t_2 := \frac{v}{u \cdot -2 - t1}\\ \mathbf{if}\;t1 \leq -1600000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq -2.3 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq -1.22 \cdot 10^{-67}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* (/ v u) (/ (- t1) u))) (t_2 (/ v (- (* u -2.0) t1))))
   (if (<= t1 -1600000.0)
     t_2
     (if (<= t1 -2.3e-28)
       t_1
       (if (<= t1 -1.22e-67) t_2 (if (<= t1 5.6e+164) t_1 (/ (- v) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = (v / u) * (-t1 / u);
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -1600000.0) {
		tmp = t_2;
	} else if (t1 <= -2.3e-28) {
		tmp = t_1;
	} else if (t1 <= -1.22e-67) {
		tmp = t_2;
	} else if (t1 <= 5.6e+164) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (v / u) * (-t1 / u)
    t_2 = v / ((u * (-2.0d0)) - t1)
    if (t1 <= (-1600000.0d0)) then
        tmp = t_2
    else if (t1 <= (-2.3d-28)) then
        tmp = t_1
    else if (t1 <= (-1.22d-67)) then
        tmp = t_2
    else if (t1 <= 5.6d+164) then
        tmp = t_1
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = (v / u) * (-t1 / u);
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -1600000.0) {
		tmp = t_2;
	} else if (t1 <= -2.3e-28) {
		tmp = t_1;
	} else if (t1 <= -1.22e-67) {
		tmp = t_2;
	} else if (t1 <= 5.6e+164) {
		tmp = t_1;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (v / u) * (-t1 / u)
	t_2 = v / ((u * -2.0) - t1)
	tmp = 0
	if t1 <= -1600000.0:
		tmp = t_2
	elif t1 <= -2.3e-28:
		tmp = t_1
	elif t1 <= -1.22e-67:
		tmp = t_2
	elif t1 <= 5.6e+164:
		tmp = t_1
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(v / u) * Float64(Float64(-t1) / u))
	t_2 = Float64(v / Float64(Float64(u * -2.0) - t1))
	tmp = 0.0
	if (t1 <= -1600000.0)
		tmp = t_2;
	elseif (t1 <= -2.3e-28)
		tmp = t_1;
	elseif (t1 <= -1.22e-67)
		tmp = t_2;
	elseif (t1 <= 5.6e+164)
		tmp = t_1;
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (v / u) * (-t1 / u);
	t_2 = v / ((u * -2.0) - t1);
	tmp = 0.0;
	if (t1 <= -1600000.0)
		tmp = t_2;
	elseif (t1 <= -2.3e-28)
		tmp = t_1;
	elseif (t1 <= -1.22e-67)
		tmp = t_2;
	elseif (t1 <= 5.6e+164)
		tmp = t_1;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / u), $MachinePrecision] * N[((-t1) / u), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1600000.0], t$95$2, If[LessEqual[t1, -2.3e-28], t$95$1, If[LessEqual[t1, -1.22e-67], t$95$2, If[LessEqual[t1, 5.6e+164], t$95$1, N[((-v) / t1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{v}{u} \cdot \frac{-t1}{u}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -1600000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq -2.3 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t1 \leq -1.22 \cdot 10^{-67}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.6e6 or -2.29999999999999986e-28 < t1 < -1.22e-67

    1. Initial program 75.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e6 < t1 < -2.29999999999999986e-28 or -1.22e-67 < t1 < 5.6000000000000004e164

    1. Initial program 75.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.4%

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

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

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

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

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

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

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

    if 5.6000000000000004e164 < t1

    1. Initial program 34.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1600000:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -2.3 \cdot 10^{-28}:\\ \;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\ \mathbf{elif}\;t1 \leq -1.22 \cdot 10^{-67}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 3: 75.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t1 \cdot \frac{v}{u}}{-u}\\ t_2 := \frac{v}{u \cdot -2 - t1}\\ \mathbf{if}\;t1 \leq -480000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq -1.15 \cdot 10^{-72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (* t1 (/ v u)) (- u))) (t_2 (/ v (- (* u -2.0) t1))))
   (if (<= t1 -480000.0)
     t_2
     (if (<= t1 -1.2e-28)
       t_1
       (if (<= t1 -1.15e-72) t_2 (if (<= t1 5.6e+164) t_1 (/ (- v) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = (t1 * (v / u)) / -u;
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -480000.0) {
		tmp = t_2;
	} else if (t1 <= -1.2e-28) {
		tmp = t_1;
	} else if (t1 <= -1.15e-72) {
		tmp = t_2;
	} else if (t1 <= 5.6e+164) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (t1 * (v / u)) / -u
    t_2 = v / ((u * (-2.0d0)) - t1)
    if (t1 <= (-480000.0d0)) then
        tmp = t_2
    else if (t1 <= (-1.2d-28)) then
        tmp = t_1
    else if (t1 <= (-1.15d-72)) then
        tmp = t_2
    else if (t1 <= 5.6d+164) then
        tmp = t_1
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = (t1 * (v / u)) / -u;
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -480000.0) {
		tmp = t_2;
	} else if (t1 <= -1.2e-28) {
		tmp = t_1;
	} else if (t1 <= -1.15e-72) {
		tmp = t_2;
	} else if (t1 <= 5.6e+164) {
		tmp = t_1;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (t1 * (v / u)) / -u
	t_2 = v / ((u * -2.0) - t1)
	tmp = 0
	if t1 <= -480000.0:
		tmp = t_2
	elif t1 <= -1.2e-28:
		tmp = t_1
	elif t1 <= -1.15e-72:
		tmp = t_2
	elif t1 <= 5.6e+164:
		tmp = t_1
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(t1 * Float64(v / u)) / Float64(-u))
	t_2 = Float64(v / Float64(Float64(u * -2.0) - t1))
	tmp = 0.0
	if (t1 <= -480000.0)
		tmp = t_2;
	elseif (t1 <= -1.2e-28)
		tmp = t_1;
	elseif (t1 <= -1.15e-72)
		tmp = t_2;
	elseif (t1 <= 5.6e+164)
		tmp = t_1;
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (t1 * (v / u)) / -u;
	t_2 = v / ((u * -2.0) - t1);
	tmp = 0.0;
	if (t1 <= -480000.0)
		tmp = t_2;
	elseif (t1 <= -1.2e-28)
		tmp = t_1;
	elseif (t1 <= -1.15e-72)
		tmp = t_2;
	elseif (t1 <= 5.6e+164)
		tmp = t_1;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -480000.0], t$95$2, If[LessEqual[t1, -1.2e-28], t$95$1, If[LessEqual[t1, -1.15e-72], t$95$2, If[LessEqual[t1, 5.6e+164], t$95$1, N[((-v) / t1), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t1 \cdot \frac{v}{u}}{-u}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -480000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t1 \leq -1.15 \cdot 10^{-72}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -4.8e5 or -1.2000000000000001e-28 < t1 < -1.14999999999999997e-72

    1. Initial program 75.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e5 < t1 < -1.2000000000000001e-28 or -1.14999999999999997e-72 < t1 < 5.6000000000000004e164

    1. Initial program 75.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-u}} \cdot \frac{v}{u} \]
      2. remove-double-neg75.9%

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

        \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{u}}{-u}} \]
    9. Applied egg-rr76.6%

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

    if 5.6000000000000004e164 < t1

    1. Initial program 34.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -480000:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-28}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{elif}\;t1 \leq -1.15 \cdot 10^{-72}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 4: 75.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{u \cdot -2 - t1}\\ \mathbf{if}\;t1 \leq -3300000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq -7 \cdot 10^{-28}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{elif}\;t1 \leq -6.3 \cdot 10^{-68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ v (- (* u -2.0) t1))))
   (if (<= t1 -3300000.0)
     t_1
     (if (<= t1 -7e-28)
       (/ (* t1 (/ v u)) (- u))
       (if (<= t1 -6.3e-68)
         t_1
         (if (<= t1 5.6e+164) (/ (/ t1 (/ u v)) (- u)) (/ (- v) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -3300000.0) {
		tmp = t_1;
	} else if (t1 <= -7e-28) {
		tmp = (t1 * (v / u)) / -u;
	} else if (t1 <= -6.3e-68) {
		tmp = t_1;
	} else if (t1 <= 5.6e+164) {
		tmp = (t1 / (u / 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) :: t_1
    real(8) :: tmp
    t_1 = v / ((u * (-2.0d0)) - t1)
    if (t1 <= (-3300000.0d0)) then
        tmp = t_1
    else if (t1 <= (-7d-28)) then
        tmp = (t1 * (v / u)) / -u
    else if (t1 <= (-6.3d-68)) then
        tmp = t_1
    else if (t1 <= 5.6d+164) then
        tmp = (t1 / (u / v)) / -u
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -3300000.0) {
		tmp = t_1;
	} else if (t1 <= -7e-28) {
		tmp = (t1 * (v / u)) / -u;
	} else if (t1 <= -6.3e-68) {
		tmp = t_1;
	} else if (t1 <= 5.6e+164) {
		tmp = (t1 / (u / v)) / -u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v / ((u * -2.0) - t1)
	tmp = 0
	if t1 <= -3300000.0:
		tmp = t_1
	elif t1 <= -7e-28:
		tmp = (t1 * (v / u)) / -u
	elif t1 <= -6.3e-68:
		tmp = t_1
	elif t1 <= 5.6e+164:
		tmp = (t1 / (u / v)) / -u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	t_1 = Float64(v / Float64(Float64(u * -2.0) - t1))
	tmp = 0.0
	if (t1 <= -3300000.0)
		tmp = t_1;
	elseif (t1 <= -7e-28)
		tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(-u));
	elseif (t1 <= -6.3e-68)
		tmp = t_1;
	elseif (t1 <= 5.6e+164)
		tmp = Float64(Float64(t1 / Float64(u / v)) / Float64(-u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v / ((u * -2.0) - t1);
	tmp = 0.0;
	if (t1 <= -3300000.0)
		tmp = t_1;
	elseif (t1 <= -7e-28)
		tmp = (t1 * (v / u)) / -u;
	elseif (t1 <= -6.3e-68)
		tmp = t_1;
	elseif (t1 <= 5.6e+164)
		tmp = (t1 / (u / v)) / -u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -3300000.0], t$95$1, If[LessEqual[t1, -7e-28], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[LessEqual[t1, -6.3e-68], t$95$1, If[LessEqual[t1, 5.6e+164], N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -3300000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq -6.3 \cdot 10^{-68}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -3.3e6 or -6.9999999999999999e-28 < t1 < -6.2999999999999998e-68

    1. Initial program 75.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3e6 < t1 < -6.9999999999999999e-28

    1. Initial program 78.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-u}} \cdot \frac{v}{u} \]
      2. remove-double-neg89.0%

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

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

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

    if -6.2999999999999998e-68 < t1 < 5.6000000000000004e164

    1. Initial program 75.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{u}}{-u}} \]
    10. Step-by-step derivation
      1. clear-num75.8%

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

        \[\leadsto \frac{\color{blue}{\frac{t1}{\frac{u}{v}}}}{-u} \]
    11. Applied egg-rr75.8%

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

    if 5.6000000000000004e164 < t1

    1. Initial program 34.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3300000:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -7 \cdot 10^{-28}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{-u}\\ \mathbf{elif}\;t1 \leq -6.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 5: 75.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{u \cdot -2 - t1}\\ \mathbf{if}\;t1 \leq -260000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq -7.5 \cdot 10^{-29}:\\ \;\;\;\;\frac{t1}{\left(t1 - u\right) \cdot \frac{u}{v}}\\ \mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ v (- (* u -2.0) t1))))
   (if (<= t1 -260000.0)
     t_1
     (if (<= t1 -7.5e-29)
       (/ t1 (* (- t1 u) (/ u v)))
       (if (<= t1 -1.2e-67)
         t_1
         (if (<= t1 5.6e+164) (/ (/ t1 (/ u v)) (- u)) (/ (- v) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -260000.0) {
		tmp = t_1;
	} else if (t1 <= -7.5e-29) {
		tmp = t1 / ((t1 - u) * (u / v));
	} else if (t1 <= -1.2e-67) {
		tmp = t_1;
	} else if (t1 <= 5.6e+164) {
		tmp = (t1 / (u / 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) :: t_1
    real(8) :: tmp
    t_1 = v / ((u * (-2.0d0)) - t1)
    if (t1 <= (-260000.0d0)) then
        tmp = t_1
    else if (t1 <= (-7.5d-29)) then
        tmp = t1 / ((t1 - u) * (u / v))
    else if (t1 <= (-1.2d-67)) then
        tmp = t_1
    else if (t1 <= 5.6d+164) then
        tmp = (t1 / (u / v)) / -u
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -260000.0) {
		tmp = t_1;
	} else if (t1 <= -7.5e-29) {
		tmp = t1 / ((t1 - u) * (u / v));
	} else if (t1 <= -1.2e-67) {
		tmp = t_1;
	} else if (t1 <= 5.6e+164) {
		tmp = (t1 / (u / v)) / -u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v / ((u * -2.0) - t1)
	tmp = 0
	if t1 <= -260000.0:
		tmp = t_1
	elif t1 <= -7.5e-29:
		tmp = t1 / ((t1 - u) * (u / v))
	elif t1 <= -1.2e-67:
		tmp = t_1
	elif t1 <= 5.6e+164:
		tmp = (t1 / (u / v)) / -u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	t_1 = Float64(v / Float64(Float64(u * -2.0) - t1))
	tmp = 0.0
	if (t1 <= -260000.0)
		tmp = t_1;
	elseif (t1 <= -7.5e-29)
		tmp = Float64(t1 / Float64(Float64(t1 - u) * Float64(u / v)));
	elseif (t1 <= -1.2e-67)
		tmp = t_1;
	elseif (t1 <= 5.6e+164)
		tmp = Float64(Float64(t1 / Float64(u / v)) / Float64(-u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v / ((u * -2.0) - t1);
	tmp = 0.0;
	if (t1 <= -260000.0)
		tmp = t_1;
	elseif (t1 <= -7.5e-29)
		tmp = t1 / ((t1 - u) * (u / v));
	elseif (t1 <= -1.2e-67)
		tmp = t_1;
	elseif (t1 <= 5.6e+164)
		tmp = (t1 / (u / v)) / -u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -260000.0], t$95$1, If[LessEqual[t1, -7.5e-29], N[(t1 / N[(N[(t1 - u), $MachinePrecision] * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.2e-67], t$95$1, If[LessEqual[t1, 5.6e+164], N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -260000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-67}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -2.6e5 or -7.50000000000000006e-29 < t1 < -1.2e-67

    1. Initial program 75.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e5 < t1 < -7.50000000000000006e-29

    1. Initial program 78.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.7%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e-67 < t1 < 5.6000000000000004e164

    1. Initial program 75.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{u}}{-u}} \]
    10. Step-by-step derivation
      1. clear-num75.8%

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

        \[\leadsto \frac{\color{blue}{\frac{t1}{\frac{u}{v}}}}{-u} \]
    11. Applied egg-rr75.8%

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

    if 5.6000000000000004e164 < t1

    1. Initial program 34.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -260000:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -7.5 \cdot 10^{-29}:\\ \;\;\;\;\frac{t1}{\left(t1 - u\right) \cdot \frac{u}{v}}\\ \mathbf{elif}\;t1 \leq -1.2 \cdot 10^{-67}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 6: 75.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{u \cdot -2 - t1}\\ \mathbf{if}\;t1 \leq -250000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq -4.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \mathbf{elif}\;t1 \leq -1.22 \cdot 10^{-67}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ v (- (* u -2.0) t1))))
   (if (<= t1 -250000.0)
     t_1
     (if (<= t1 -4.8e-28)
       (/ (* t1 (/ v u)) (- t1 u))
       (if (<= t1 -1.22e-67)
         t_1
         (if (<= t1 5.6e+164) (/ (/ t1 (/ u v)) (- u)) (/ (- v) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -250000.0) {
		tmp = t_1;
	} else if (t1 <= -4.8e-28) {
		tmp = (t1 * (v / u)) / (t1 - u);
	} else if (t1 <= -1.22e-67) {
		tmp = t_1;
	} else if (t1 <= 5.6e+164) {
		tmp = (t1 / (u / 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) :: t_1
    real(8) :: tmp
    t_1 = v / ((u * (-2.0d0)) - t1)
    if (t1 <= (-250000.0d0)) then
        tmp = t_1
    else if (t1 <= (-4.8d-28)) then
        tmp = (t1 * (v / u)) / (t1 - u)
    else if (t1 <= (-1.22d-67)) then
        tmp = t_1
    else if (t1 <= 5.6d+164) then
        tmp = (t1 / (u / v)) / -u
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -250000.0) {
		tmp = t_1;
	} else if (t1 <= -4.8e-28) {
		tmp = (t1 * (v / u)) / (t1 - u);
	} else if (t1 <= -1.22e-67) {
		tmp = t_1;
	} else if (t1 <= 5.6e+164) {
		tmp = (t1 / (u / v)) / -u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v / ((u * -2.0) - t1)
	tmp = 0
	if t1 <= -250000.0:
		tmp = t_1
	elif t1 <= -4.8e-28:
		tmp = (t1 * (v / u)) / (t1 - u)
	elif t1 <= -1.22e-67:
		tmp = t_1
	elif t1 <= 5.6e+164:
		tmp = (t1 / (u / v)) / -u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	t_1 = Float64(v / Float64(Float64(u * -2.0) - t1))
	tmp = 0.0
	if (t1 <= -250000.0)
		tmp = t_1;
	elseif (t1 <= -4.8e-28)
		tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(t1 - u));
	elseif (t1 <= -1.22e-67)
		tmp = t_1;
	elseif (t1 <= 5.6e+164)
		tmp = Float64(Float64(t1 / Float64(u / v)) / Float64(-u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v / ((u * -2.0) - t1);
	tmp = 0.0;
	if (t1 <= -250000.0)
		tmp = t_1;
	elseif (t1 <= -4.8e-28)
		tmp = (t1 * (v / u)) / (t1 - u);
	elseif (t1 <= -1.22e-67)
		tmp = t_1;
	elseif (t1 <= 5.6e+164)
		tmp = (t1 / (u / v)) / -u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -250000.0], t$95$1, If[LessEqual[t1, -4.8e-28], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.22e-67], t$95$1, If[LessEqual[t1, 5.6e+164], N[(N[(t1 / N[(u / v), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -250000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq -1.22 \cdot 10^{-67}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -2.5e5 or -4.8000000000000004e-28 < t1 < -1.22e-67

    1. Initial program 75.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e5 < t1 < -4.8000000000000004e-28

    1. Initial program 78.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{u}}{-\left(t1 + u\right)}} \]
      6. distribute-neg-in88.9%

        \[\leadsto \frac{t1 \cdot \frac{v}{u}}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      7. add-sqr-sqrt88.9%

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

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

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

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

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

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

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

    if -1.22e-67 < t1 < 5.6000000000000004e164

    1. Initial program 75.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t1 \cdot \frac{v}{u}}{-u}} \]
    10. Step-by-step derivation
      1. clear-num75.8%

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

        \[\leadsto \frac{\color{blue}{\frac{t1}{\frac{u}{v}}}}{-u} \]
    11. Applied egg-rr75.8%

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

    if 5.6000000000000004e164 < t1

    1. Initial program 34.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -250000:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -4.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \mathbf{elif}\;t1 \leq -1.22 \cdot 10^{-67}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{t1}{\frac{u}{v}}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 7: 61.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.2 \cdot 10^{+148} \lor \neg \left(u \leq 1.5 \cdot 10^{+247}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.1999999999999999e148 or 1.5e247 < u

    1. Initial program 82.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac96.5%

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

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

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      2. clear-num96.5%

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. remove-double-neg92.9%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. distribute-neg-in92.9%

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

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

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

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      13. sub-neg92.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{t1}{t1 \cdot u} \cdot v} \]
      2. *-commutative51.5%

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{u}}{t1}} \cdot v \]
    9. Applied egg-rr64.3%

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

    if -3.1999999999999999e148 < u < 1.5e247

    1. Initial program 68.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.2 \cdot 10^{+148} \lor \neg \left(u \leq 1.5 \cdot 10^{+247}\right):\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 8: 69.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -6.8 \cdot 10^{+102} \lor \neg \left(u \leq 1.95 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -6.8000000000000001e102 or 1.9500000000000001e90 < u

    1. Initial program 70.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-t1}{\frac{u}{\frac{v}{u}}}} \]
      3. add-sqr-sqrt41.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{t1}}{\frac{u}{\frac{v}{u}}} \]
    9. Applied egg-rr66.4%

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

    if -6.8000000000000001e102 < u < 1.9500000000000001e90

    1. Initial program 72.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -6.8 \cdot 10^{+102} \lor \neg \left(u \leq 1.95 \cdot 10^{+90}\right):\\ \;\;\;\;\frac{t1}{\frac{u}{\frac{v}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 9: 67.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.75 \cdot 10^{+149} \lor \neg \left(u \leq 1.5 \cdot 10^{+247}\right):\\
\;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.75000000000000016e149 or 1.5e247 < u

    1. Initial program 82.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac96.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot v}{\frac{u}{-t1} \cdot u}} \]
      3. *-un-lft-identity82.3%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot u} \]
      4. add-sqr-sqrt42.0%

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

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

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

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot u} \]
      8. add-sqr-sqrt82.3%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot u} \]
    9. Applied egg-rr82.3%

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

    if -3.75000000000000016e149 < u < 1.5e247

    1. Initial program 68.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.7%

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/98.0%

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u + t1}}{-t1}} \]
      6. remove-double-neg98.0%

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

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

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

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

        \[\leadsto \frac{v}{\left(t1 + u\right) \cdot \left(\frac{u}{-t1} + \left(-\color{blue}{1}\right)\right)} \]
      11. metadata-eval98.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.75 \cdot 10^{+149} \lor \neg \left(u \leq 1.5 \cdot 10^{+247}\right):\\ \;\;\;\;\frac{v}{u \cdot \frac{u}{t1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]

Alternative 10: 57.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.08 \cdot 10^{+163}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.08e+163) (* (/ t1 u) (/ v t1)) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.08e+163) {
		tmp = (t1 / u) * (v / t1);
	} 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.08d+163)) then
        tmp = (t1 / u) * (v / t1)
    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.08e+163) {
		tmp = (t1 / u) * (v / t1);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.08e+163:
		tmp = (t1 / u) * (v / t1)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.08e+163)
		tmp = Float64(Float64(t1 / u) * Float64(v / t1));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.08e+163)
		tmp = (t1 / u) * (v / t1);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.08e+163], N[(N[(t1 / u), $MachinePrecision] * N[(v / t1), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.08 \cdot 10^{+163}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.0800000000000001e163

    1. Initial program 78.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac94.7%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. *-commutative94.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. remove-double-neg91.9%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. distribute-neg-in91.9%

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      10. sqr-neg89.2%

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      13. sub-neg91.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{t1 \cdot v}{t1 \cdot u}} \]
      2. *-commutative56.4%

        \[\leadsto \frac{\color{blue}{v \cdot t1}}{t1 \cdot u} \]
      3. times-frac61.8%

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

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

    if -1.0800000000000001e163 < u

    1. Initial program 70.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified58.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.08 \cdot 10^{+163}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 11: 23.5% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.5 \cdot 10^{+128} \lor \neg \left(t1 \leq 1.3 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.5e128 or 1.3e172 < t1

    1. Initial program 51.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac100.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot v}{t1 + u}} \]
      2. clear-num100.0%

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

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. *-un-lft-identity100.0%

        \[\leadsto \frac{\frac{\color{blue}{v}}{\frac{t1 + u}{-t1}}}{t1 + u} \]
      5. frac-2neg100.0%

        \[\leadsto \frac{\frac{v}{\color{blue}{\frac{-\left(t1 + u\right)}{-\left(-t1\right)}}}}{t1 + u} \]
      6. distribute-neg-in100.0%

        \[\leadsto \frac{\frac{v}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{-\left(-t1\right)}}}{t1 + u} \]
      7. add-sqr-sqrt61.4%

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

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

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

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

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

        \[\leadsto \frac{\frac{v}{\frac{\color{blue}{t1 - u}}{-\left(-t1\right)}}}{t1 + u} \]
      13. remove-double-neg54.3%

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

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

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

    if -2.5e128 < t1 < 1.3e172

    1. Initial program 78.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.9%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. *-commutative97.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. remove-double-neg85.9%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. distribute-neg-in85.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 56.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.85 \cdot 10^{+163}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.85e+163) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.85e+163) {
		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.85d+163)) 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.85e+163) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.85e+163:
		tmp = v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.85e+163)
		tmp = 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.85e+163)
		tmp = v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.85e+163], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.85 \cdot 10^{+163}:\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.84999999999999996e163

    1. Initial program 78.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac94.7%

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Step-by-step derivation
      1. *-commutative94.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-\left(-t1\right)}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. remove-double-neg91.9%

        \[\leadsto \frac{\color{blue}{t1}}{\frac{t1 + u}{v} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. distribute-neg-in91.9%

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      10. sqr-neg89.2%

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

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

        \[\leadsto \frac{t1}{\frac{t1 + u}{v} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      13. sub-neg91.9%

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

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

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

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

    if -1.84999999999999996e163 < u

    1. Initial program 70.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified58.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.85 \cdot 10^{+163}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 13: 14.0% 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 71.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.5%

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

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

      \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot v}{t1 + u}} \]
    2. clear-num98.2%

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

      \[\leadsto \frac{\color{blue}{\frac{1 \cdot v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
    4. *-un-lft-identity98.2%

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

      \[\leadsto \frac{\frac{v}{\color{blue}{\frac{-\left(t1 + u\right)}{-\left(-t1\right)}}}}{t1 + u} \]
    6. distribute-neg-in98.2%

      \[\leadsto \frac{\frac{v}{\frac{\color{blue}{\left(-t1\right) + \left(-u\right)}}{-\left(-t1\right)}}}{t1 + u} \]
    7. add-sqr-sqrt54.6%

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

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

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

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

      \[\leadsto \frac{\frac{v}{\frac{\color{blue}{t1} + \left(-u\right)}{-\left(-t1\right)}}}{t1 + u} \]
    12. sub-neg61.9%

      \[\leadsto \frac{\frac{v}{\frac{\color{blue}{t1 - u}}{-\left(-t1\right)}}}{t1 + u} \]
    13. remove-double-neg61.9%

      \[\leadsto \frac{\frac{v}{\frac{t1 - u}{\color{blue}{t1}}}}{t1 + u} \]
  5. Applied egg-rr61.9%

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

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  7. Final simplification16.2%

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

Reproduce

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